/* ================================================================
   TrueTest Labs — Base
   Reset, typography, layout primitives, utilities
   ================================================================ */

/* ---------- Fonts (Google Fonts fallback until self-hosted) ---------- */
/* For Phase 1 we still load from Google Fonts; Phase 3 will self-host.
   Using Fraunces (display) + Inter (body) — variable fonts, one file each. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..700;1,9..144,400..600&family=Inter:wght@400;500;600;700&display=swap');

/* ---------- Modern reset (Andy Bell, condensed) ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; line-height: var(--lh-normal); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; border-spacing: 0; }

/* ---------- Element defaults ---------- */
html {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink-900);
  background: var(--paper);
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  color: var(--ink-700);
  background: var(--paper);
  font-feature-settings: "ss01", "cv11"; /* Inter stylistic alternates */
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink-900);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  font-weight: 500;
}

h4, h5, h6 {
  font-family: var(--font-body);
  color: var(--ink-900);
  line-height: var(--lh-snug);
  font-weight: 600;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p { color: var(--ink-700); }

a {
  color: var(--brand-navy-500);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--brand-navy-700); }

strong, b { font-weight: 600; color: var(--ink-900); }

/* Focus ring — visible on keyboard, invisible on mouse click */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand-navy-500);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: var(--brand-gold-400); color: var(--brand-navy-900); }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}
.container-narrow { max-width: var(--container-narrow); }
.container-prose { max-width: var(--container-prose); }

.section { padding-block: var(--section-y); }
.section-tight { padding-block: clamp(2.5rem, 4vw, 4rem); }

.stack > * + * { margin-top: var(--stack-space, var(--space-4)); }
.stack-lg > * + * { margin-top: var(--space-6); }
.stack-xl > * + * { margin-top: var(--space-8); }

.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--space-3)); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--grid-gap, var(--space-6)); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--grid-gap, var(--space-6)); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--grid-gap, var(--space-4)); }

.split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

@media (max-width: 900px) {
  .grid-3, .grid-4, .split { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Utilities ---------- */
.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;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--brand-navy-900);
  color: var(--paper);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  z-index: var(--z-toast);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 8px; color: var(--paper); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--brand-gold-700);
}

.text-muted { color: var(--ink-500); }
.text-center { text-align: center; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

.lead {
  font-size: clamp(1.0625rem, 0.5vw + 1rem, 1.25rem);
  line-height: var(--lh-relaxed);
  color: var(--ink-600);
  max-width: 62ch;
}

.divider {
  border: 0;
  height: 1px;
  background: var(--line);
  margin-block: var(--space-8);
}
.divider-gold {
  border: 0;
  height: 2px;
  width: 48px;
  background: var(--brand-gold-600);
  margin: 0;
}
