/* ==========================================================================
   IMARA GROUP — Production Stylesheet
   Implements Brand System v2.0 design tokens + Website Implementation
   Specification v2.0 component rules. Architecture/IA locked at Stage 1.
   ========================================================================== */

/* ---- 1. Design tokens -------------------------------------------------- */
:root {
  /* Colour */
  --navy: #0F172A;
  --emerald: #059669;
  --emerald-dark: #047a56;
  --blue: #2563EB;
  --slate: #64748B;
  --slate-light: #CBD5E1;
  --bg: #F8FAFC;
  --white: #FFFFFF;

  /* Text */
  --text-primary: var(--navy);
  --text-secondary: var(--slate);
  --text-inverse: var(--white);

  /* Type */
  --font-body: 'Inter', 'Aptos', Arial, sans-serif;
  --fs-h1: clamp(2.25rem, 1.9rem + 1.6vw, 3.5rem);
  --fs-h2: clamp(1.75rem, 1.55rem + 0.9vw, 2.5rem);
  --fs-h3: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --lh-heading: 1.15;
  --lh-body: 1.65;

  /* Spacing (8px base) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --space-12: 96px;
  --space-15: 120px;

  /* Layout */
  --content-max: 1200px;
  --measure: 680px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --border: 1px solid var(--slate-light);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 150ms;
  --dur-med: 280ms;
  --dur-slow: 480ms;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12), 0 8px 16px rgba(15, 23, 42, 0.06);

  /* Header height (used for scroll-offset anchors) */
  --header-h: 76px;
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-med: 0ms; --dur-slow: 0ms; }
}

/* ---- 2. Reset ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-primary);
  background: var(--bg);
  font-display: swap;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: -0.01em;
  color: var(--navy);
}
h1 { font-size: var(--fs-h1); font-weight: 700; }
h2 { font-size: var(--fs-h2); font-weight: 600; }
h3 { font-size: var(--fs-h3); font-weight: 600; }

p.lede { font-size: 1.125rem; color: var(--text-secondary); }

/* Visible focus state everywhere (WCAG 2.2 AA) */
:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 3px;
  border-radius: 4px;
}
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute;
  top: -48px;
  left: var(--space-2);
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: var(--space-2); }

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

/* ---- 3. Layout helpers --------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.measure { max-width: var(--measure); }

.section { padding-block: var(--space-12); }
.section--tight { padding-block: var(--space-8); }
.section--quiet { background: var(--white); }

@media (max-width: 1023px) {
  .section { padding-block: var(--space-8); }
}
@media (max-width: 639px) {
  .section { padding-block: var(--space-6); }
  .container { padding-inline: var(--space-2); }
}

.grid { display: grid; gap: var(--space-3); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1023px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 639px) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--emerald-dark);
  margin-bottom: var(--space-2);
}
.eyebrow::before {
  content: "";
  width: 18px; height: 2px;
  background: var(--emerald);
  display: inline-block;
}

/* ---- 4. Buttons & links --------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--navy);
  color: var(--white);
}
.btn--primary:hover { background: #1a2740; box-shadow: var(--shadow-md); }

.btn--accent {
  /* WCAG AA: white-on-Emerald is 3.77:1 (fails 4.5:1 for normal text).
     Emerald-dark gives 5.35:1 — same accent family, accessible for text. */
  background: var(--emerald-dark);
  color: var(--white);
}
.btn--accent:hover { background: #036249; box-shadow: var(--shadow-md); }

.btn--ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--slate-light);
}
.btn--ghost:hover { border-color: var(--navy); background: rgba(15,23,42,0.03); }

.btn--on-dark {
  /* Same AA fix as .btn--accent — see note above. */
  background: var(--emerald-dark);
  color: var(--white);
}
.btn--on-dark:hover { background: #036249; }

.btn--full { width: 100%; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--emerald-dark);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease), gap var(--dur-fast) var(--ease);
}
.text-link:hover { border-color: currentColor; }
.text-link .arrow { transition: transform var(--dur-fast) var(--ease); }
.text-link:hover .arrow { transform: translateX(3px); }

/* ---- 5. Header ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease),
              background var(--dur-med) var(--ease);
}
.site-header.is-scrolled {
  border-color: var(--slate-light);
  box-shadow: var(--shadow-sm);
  background: rgba(248, 250, 252, 0.97);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: var(--space-3);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  color: var(--navy);
  flex-shrink: 0;
}
.logo__mark { width: 30px; height: 30px; flex-shrink: 0; }
.logo__word .accent { color: var(--emerald); font-weight: 700; }

.nav-primary {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav-primary__list {
  display: flex;
  gap: var(--space-3);
}
.nav-primary__link {
  position: relative;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--navy);
  padding: 8px 2px;
}
.nav-primary__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--emerald);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-fast) var(--ease);
}
.nav-primary__link:hover::after,
.nav-primary__link[aria-current="page"]::after { transform: scaleX(1); }
.nav-primary__link[aria-current="page"] { color: var(--emerald-dark); }

.header-cta { display: flex; align-items: center; gap: var(--space-2); }

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--slate-light);
  border-radius: var(--radius-sm);
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
}
.menu-toggle__bars,
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  content: "";
  display: block;
  width: 20px; height: 2px;
  background: var(--navy);
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.menu-toggle__bars { position: relative; }
.menu-toggle__bars::before { position: absolute; top: -6px; }
.menu-toggle__bars::after { position: absolute; top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--navy);
  z-index: 99;
  padding: var(--space-4) var(--space-3);
  overflow-y: auto;
}
.mobile-nav.is-open { display: block; }
.mobile-nav__list { display: flex; flex-direction: column; gap: var(--space-1); }
.mobile-nav__link {
  display: block;
  padding: 16px 4px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.mobile-nav .btn { margin-top: var(--space-3); }

@media (max-width: 1023px) {
  .nav-primary__list { display: none; }
  .header-cta .btn--primary { display: none; }
  .menu-toggle { display: flex; }
}

body.nav-open {
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100%;
}

/* Fallback for browsers without native [inert] support: visually hide and
   remove from the accessibility tree while the mobile nav is open. */
[inert] { pointer-events: none; }
@supports not selector(:has(a)) {
  [inert] { display: none; }
}

/* ---- 6. Hero ---------------------------------------------------------- */
.hero {
  padding-block: var(--space-15) var(--space-12);
  position: relative;
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-8);
  align-items: center;
}
@media (max-width: 1023px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero { padding-block: var(--space-8) var(--space-6); }
}
/* Homepage-only: single-column hero (no visual placeholder column) */
.hero--single .hero__grid {
  grid-template-columns: 1fr;
  max-width: 780px;
  margin-inline: auto;
}
.hero__eyebrow { color: var(--emerald-dark); }
.hero h1 { max-width: 16ch; }
.hero__sub {
  margin-top: var(--space-3);
  max-width: 52ch;
  font-size: 1.125rem;
  color: var(--text-secondary);
}
.hero__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

/* ---- 8. Cards ------------------------------------------------------------ */
.card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: transparent; }

.card__icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(5, 150, 105, 0.1);
  color: var(--emerald-dark);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-2);
}
.card__icon svg { width: 22px; height: 22px; }

.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-secondary); font-size: 0.9375rem; }
.card .text-link { margin-top: var(--space-2); }

/* Solution card status */
.card--solution { display: flex; flex-direction: column; }
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: var(--space-2);
  width: fit-content;
}
.status-badge--active { background: rgba(5,150,105,0.12); color: var(--emerald-dark); }
.status-badge--emerging { background: rgba(100,116,139,0.12); color: var(--slate); }
.status-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.card--quiet {
  background: transparent;
  border-style: dashed;
  opacity: 0.92;
}
.card--quiet:hover { transform: none; box-shadow: none; }

/* ---- 9. Imara Perspective callout ---------------------------------------- */
.perspective {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
}
.perspective::before {
  content: "";
  position: absolute; top: 0; left: 0;
  width: 4px; height: 64px;
  background: var(--emerald);
  border-radius: 0 4px 4px 0;
}
.perspective__label { color: var(--emerald); font-weight: 600; font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.06em; }
.perspective p { margin-top: var(--space-2); font-size: 1.125rem; max-width: 62ch; color: rgba(255,255,255,0.92); }

/* ---- 10. Trust strip ---------------------------------------------------- */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-top: var(--border);
  border-bottom: var(--border);
}
.trust-strip__item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-weight: 500;
}
.trust-strip__item svg { width: 18px; height: 18px; color: var(--emerald); flex-shrink: 0; }

/* ---- 11. CTA band --------------------------------------------------------- */
.cta-band {
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band::after {
  content: "";
  position: absolute;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(5,150,105,0.25), transparent 70%);
  top: -240px; right: -160px;
  pointer-events: none;
}
.cta-band h2 { color: var(--white); max-width: 22ch; margin-inline: auto; }
.cta-band p { color: rgba(255,255,255,0.75); margin-top: var(--space-2); }
.cta-band .hero__actions { justify-content: center; margin-top: var(--space-4); position: relative; z-index: 1; }

/* ---- 12. Insights card ---------------------------------------------------- */
.insight-card { display: flex; flex-direction: column; }
.insight-card__meta {
  display: flex; gap: var(--space-2); align-items: center;
  font-size: var(--fs-small); color: var(--text-secondary); margin-bottom: 8px;
}
.insight-card__category { color: var(--emerald-dark); font-weight: 600; }
.insight-card h3 { font-size: 1.125rem; }

/* ---- 12a. Insight article typography ----------------------------------- */
/* Article headings are deliberately quieter than homepage and solution-page
   headings, so long-form reading remains balanced on desktop and mobile. */
.insight-article h1 {
  max-width: 19ch;
  font-size: clamp(2.25rem, 2rem + 1vw, 3rem);
  margin-top: var(--space-2);
}
.insight-article h2 {
  font-size: clamp(1.5rem, 1.35rem + 0.5vw, 2rem);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-3);
  border: 1px dashed var(--slate-light);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

/* ---- 13. Footer ------------------------------------------------------------ */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.8);
  padding-block: var(--space-8) var(--space-4);
  margin-top: var(--space-12);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 1023px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 639px) { .footer__grid { grid-template-columns: 1fr; gap: var(--space-3); } }

.footer__brand .logo { color: var(--white); }
.footer__brand p { margin-top: var(--space-2); font-size: 0.9375rem; max-width: 32ch; color: rgba(255,255,255,0.65); }
.footer__heading { font-size: var(--fs-small); text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.5); margin-bottom: var(--space-2); }
.footer__list li { margin-bottom: 10px; }
.footer__list a { font-size: 0.9375rem; transition: color var(--dur-fast) var(--ease); }
.footer__list a:hover { color: var(--emerald); }
.footer__bottom {
  margin-top: var(--space-6);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--fs-small);
  color: rgba(255,255,255,0.5);
}
.footer__bottom a:hover { color: var(--white); }

/* ---- 14. Forms ------------------------------------------------------------ */
.form-field { margin-bottom: var(--space-3); }
.form-field label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 6px;
}
.form-field .optional { color: var(--text-secondary); font-weight: 400; }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--slate-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font: inherit;
  background: var(--white);
  color: var(--navy);
  min-height: 48px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.form-field textarea { min-height: 128px; resize: vertical; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(5,150,105,0.15);
  outline: none;
}
.form-field .field-error {
  display: none;
  color: #B91C1C;
  font-size: var(--fs-small);
  margin-top: 6px;
  font-weight: 500;
}
.form-field.has-error input,
.form-field.has-error textarea,
.form-field.has-error select { border-color: #B91C1C; }
.form-field.has-error .field-error { display: block; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 639px) { .form-row { grid-template-columns: 1fr; } }

.checkbox-field { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.checkbox-field input { width: 20px; height: 20px; min-height: unset; margin-top: 2px; accent-color: var(--emerald); }
.checkbox-field label { font-weight: 400; font-size: 0.9375rem; }
.checkbox-field .field-error { flex-basis: 100%; margin-left: 30px; margin-top: -4px; }

.form-status {
  display: none;
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  font-size: 0.9375rem;
  font-weight: 500;
}
.form-status--success { background: rgba(5,150,105,0.1); color: var(--emerald-dark); }
.form-status--error { background: rgba(185,28,28,0.08); color: #B91C1C; }
.form-status.is-visible { display: block; }

/* ---- 15. Boundary / callout note -------------------------------------- */
.callout {
  border-left: 3px solid var(--blue);
  background: rgba(37,99,235,0.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-3);
  font-size: 0.9375rem;
  color: var(--text-secondary);
}
.callout strong { color: var(--navy); }

/* ---- 16. Two-column content ------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: start;
}
@media (max-width: 1023px) { .split { grid-template-columns: 1fr; gap: var(--space-4); } }

.split--reverse { grid-template-columns: 1fr 1fr; }
.split--reverse > *:first-child { order: 2; }
@media (max-width: 1023px) { .split--reverse > *:first-child { order: 0; } }

/* ---- 17. Steps / process list ------------------------------------------ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); counter-reset: step; }
@media (max-width: 1023px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: var(--space-2); }
.step__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  font-weight: 700; font-size: 0.9375rem;
  margin-bottom: var(--space-2);
}

/* ---- 18. Filters (Insights) --------------------------------------------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: var(--space-4); }
.filter-chip {
  border: 1px solid var(--slate-light);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--white);
  transition: all var(--dur-fast) var(--ease);
}
.filter-chip[aria-pressed="true"] { background: var(--navy); color: var(--white); border-color: var(--navy); }
.filter-chip:hover:not([aria-pressed="true"]) { border-color: var(--navy); color: var(--navy); }

/* ---- 19. Scroll-reveal utility ----------------------------------------- */
/* Visible by default — this is the no-JS / JS-failed / print / screenshot
   state. The hidden starting state below only applies once main.js has
   successfully run and added .js to <html>; without that class, .reveal
   content is indistinguishable from ordinary static content. */
.reveal {
  opacity: 1;
  transform: none;
}
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal, .js .reveal { opacity: 1; transform: none; transition: none; }
}

@media print {
  .reveal, .js .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---- 20. Legal / long-form content -------------------------------------- */
.legal-header { padding-block: var(--space-6) var(--space-3); border-bottom: var(--border); }
.legal-content { max-width: var(--measure); padding-block: var(--space-6); }
.legal-content h2 { margin-top: var(--space-6); margin-bottom: var(--space-2); font-size: 1.375rem; }
.legal-content p, .legal-content li { color: var(--text-secondary); margin-bottom: var(--space-2); }
.legal-content li { margin-left: var(--space-3); list-style: disc; }
.legal-toc {
  background: var(--white);
  border: var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-bottom: var(--space-4);
}
.legal-toc__title { font-weight: 700; margin-bottom: var(--space-2); }
.legal-toc a { display: block; padding: 6px 0; color: var(--text-secondary); font-size: 0.9375rem; }
.legal-toc a:hover { color: var(--emerald-dark); }

/* ---- 21. 404 -------------------------------------------------------------- */
.error-page {
  text-align: center;
  padding-block: var(--space-15);
}
.error-page__code {
  font-size: clamp(4rem, 3rem + 6vw, 8rem);
  font-weight: 700;
  color: var(--slate-light);
  line-height: 1;
}
.error-page__actions { display: flex; gap: var(--space-2); justify-content: center; margin-top: var(--space-4); flex-wrap: wrap; }

/* ---- 22. Utility ----------------------------------------------------------- */
.mt-1 { margin-top: var(--space-1); } .mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); } .mt-8 { margin-top: var(--space-8); }
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
/* Insight article typography */
.insight-article {
  font-size: 1.0625rem;
  line-height: 1.75;
}

.insight-article h1 {
  max-width: 24ch;
  font-size: clamp(2rem, 1.8rem + 0.7vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.insight-article h2 {
  font-size: clamp(1.375rem, 1.28rem + 0.3vw, 1.625rem);
  line-height: 1.25;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}