/* ==========================================================================
   base.css - globals on top of Bootstrap Reboot
   Element defaults, typography primitives, links, focus, skip link, motion.
   ========================================================================== */

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Anchored sections must clear the sticky header. */
  scroll-padding-top: calc(var(--header-h) + var(--space-6));
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  letter-spacing: var(--tracking-heading);
  line-height: var(--lh-heading);
  text-wrap: balance;
}

/* Prose carries the measured warm near-black; headings keep the pure ink. */
p {
  margin: 0;
  color: var(--text-warm);
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Measured signature: the live page sets one word of a display heading in
   Playfair Display italic ("Works with *every* agent.", "Current *skills*.").
   Carried by <em>, so the emphasis is in the markup rather than the styling. */
h1 em,
h2 em,
h3 em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
}

strong {
  font-weight: 600;
  color: var(--text);
}

/* Meta label: uppercase mono with the measured 0.16em tracking. The live page
   uses this for every section eyebrow, tier name and footer column head. */
.label {
  margin: 0;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: var(--tracking-label);
  line-height: 1.4;
  text-transform: uppercase;
}

/* Links ------------------------------------------------------------------ */

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur) ease, border-color var(--dur) ease, background-color var(--dur) ease;
}

/* Inline links get a persistent underline so colour is never the only signal. */
.text-link {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.text-link:hover {
  color: var(--accent-text);
  text-decoration-color: var(--accent);
}

/* Focus ------------------------------------------------------------------ */

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

/* Mouse users do not get the ring; keyboard users always do. */
:focus:not(:focus-visible) {
  outline: none;
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: var(--z-skip);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-body-sm);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Media ------------------------------------------------------------------ */

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

img {
  height: auto;
}

svg {
  flex: none;
}

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

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

/* Scroll-reveal base state. Gated behind html.js so the page renders fully
   when JavaScript is unavailable. */
html.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

html.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  html.js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
