/* Resources hub + article pages. Hand-written; the HTML around it is
 * generated (scripts/marketing/resources/). The shared header, wordmark and
 * card treatment come from site-chrome.css — this file only adds the reading
 * surface. Palette mirrors the landing page's :root so the routes don't
 * drift; site-chrome.css deliberately uses literal values for the same
 * reason, and these tokens are scoped to .res-body so nothing leaks into it. */

.res-body {
  --res-bg: #fafafa;
  --res-surface: #ffffff;
  --res-text: #1a1a1f;
  --res-dim: #55555f;
  --res-muted: #6b6b76;
  --res-border: #e8e8ec;
  /* The brand blue is #2f6bff, which measures 4.31:1 on this page's #fafafa
   * and 3.94:1 on the #eaf0ff tint — under the 4.5:1 AA floor for text.
   * This is the same hue with the lightness pulled down until it clears on
   * every surface it lands on (4.58:1 worst case). Verified with Lighthouse,
   * which flagged the original on every link and eyebrow. */
  --res-accent: #1b5cff;
  --res-accent-soft: rgba(27, 92, 255, 0.08);

  margin: 0;
  background: var(--res-bg);
  color: var(--res-text);
  font-family: "Outfit", system-ui, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Clears the 72px fixed header from site-chrome.css. */
.res-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 132px 24px 0;
}

/* ── Breadcrumb + title block ─────────────────────────────────────────── */

.res-crumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--res-muted);
  margin-bottom: 28px;
}

.res-crumbs a {
  color: var(--res-muted);
  text-decoration: none;
}

.res-crumbs a:hover {
  color: var(--res-accent);
  text-decoration: underline;
}

.res-eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--res-accent);
}

.res-title {
  margin: 0 0 20px;
  font-size: clamp(34px, 5vw, 50px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -1.2px;
}

.res-standfirst {
  margin: 0 0 20px;
  font-size: 19px;
  color: var(--res-dim);
}

.res-meta {
  margin: 0 0 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--res-border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: var(--res-muted);
}

.res-meta__updated {
  color: var(--res-accent);
}

/* ── On this page ─────────────────────────────────────────────────────── */

.res-toc {
  margin: 0 0 44px;
  padding: 22px 26px;
  background: var(--res-surface);
  border: 1px solid var(--res-border);
  border-left: 3px solid var(--res-accent);
  border-radius: 10px;
}

.res-toc__label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--res-muted);
}

.res-toc ol {
  margin: 0;
  padding-left: 20px;
  font-size: 15px;
}

.res-toc li {
  margin-bottom: 6px;
}

/* `ol a` for specificity: the contents list is rendered INSIDE .res-prose, so
 * a bare `.res-toc a` ties with `.res-prose a` and loses on source order —
 * which silently painted every contents link blue and underlined, the exact
 * treatment this card is meant to avoid. */
.res-toc ol a {
  color: var(--res-dim);
  text-decoration: none;
}

.res-toc ol a:hover {
  color: var(--res-accent);
  text-decoration: underline;
}

/* ── Article prose ────────────────────────────────────────────────────── */

.res-prose {
  font-size: 17.5px;
  color: var(--res-text);
}

.res-prose h2 {
  margin: 56px 0 16px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.5px;
  /* Anchored headings land below the fixed header, not under it. */
  scroll-margin-top: 96px;
}

.res-prose h3 {
  margin: 38px 0 12px;
  font-size: 21px;
  font-weight: 700;
  scroll-margin-top: 96px;
}

.res-prose h4 {
  margin: 30px 0 10px;
  font-size: 17.5px;
  font-weight: 700;
  color: var(--res-dim);
  scroll-margin-top: 96px;
}

.res-prose p {
  margin: 0 0 22px;
}

.res-prose ul,
.res-prose ol {
  margin: 0 0 24px;
  padding-left: 26px;
}

.res-prose li {
  margin-bottom: 10px;
}

.res-prose a {
  color: var(--res-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.res-prose strong {
  font-weight: 700;
}

.res-prose code {
  padding: 2px 6px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.88em;
  background: var(--res-accent-soft);
  border-radius: 4px;
}

.res-prose pre {
  margin: 0 0 24px;
  padding: 18px 20px;
  overflow-x: auto;
  background: var(--res-surface);
  border: 1px solid var(--res-border);
  border-radius: 10px;
}

.res-prose pre code {
  padding: 0;
  background: none;
}

.res-prose blockquote {
  margin: 0 0 26px;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--res-accent);
  color: var(--res-dim);
  font-size: 18.5px;
}

.res-prose blockquote p {
  margin: 0;
}

.res-prose hr {
  margin: 44px 0;
  border: 0;
  border-top: 1px solid var(--res-border);
}

/* Wide tables scroll inside the article; the page body never does. */
.prose-table {
  margin: 0 0 26px;
  overflow-x: auto;
  border: 1px solid var(--res-border);
  border-radius: 10px;
  background: var(--res-surface);
}

.prose-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
}

.prose-table th,
.prose-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--res-border);
}

.prose-table th {
  font-weight: 700;
  white-space: nowrap;
}

.prose-table tr:last-child td {
  border-bottom: 0;
}

/* ── Hub ──────────────────────────────────────────────────────────────── */

.res-hub-head {
  padding-bottom: 20px;
}

.res-grid {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 16px;
}

.res-card {
  background: var(--res-surface);
  border: 1px solid var(--res-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.18s ease,
    transform 0.18s ease;
}

.res-card:hover {
  border-color: var(--res-accent);
  transform: translateY(-2px);
}

.res-card__link {
  display: block;
  padding: 26px 28px;
  text-decoration: none;
  color: inherit;
}

.res-card__topic {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--res-accent);
}

.res-card__title {
  margin: 0 0 10px;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.4px;
}

.res-card__blurb {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--res-dim);
}

.res-card__meta {
  margin: 0;
  display: flex;
  gap: 8px;
  font-size: 13.5px;
  color: var(--res-muted);
}

/* ── Keep Reading ─────────────────────────────────────────────────────── */

/* Sibling articles at the foot of a post. Borrows the hub's
 * .res-grid and .res-card, so only the wrapper needs rules. Sits above
 * .res-cta, which owns the margin that separates the two. */
.res-related {
  margin: 56px 0 0;
}

/* The eyebrow metrics of .res-card__topic, but muted rather than accent: the
 * cards below carry accent topic labels, and a second accent line above them
 * would compete instead of introduce. */
.res-related__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--res-muted);
}

/* ── Closing CTA ──────────────────────────────────────────────────────── */

.res-cta {
  margin: 72px 0 0;
  padding: 40px;
  background: var(--res-surface);
  border: 1px solid var(--res-border);
  border-radius: 14px;
  text-align: center;
}

.res-cta__title {
  margin: 0 0 10px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.res-cta__body {
  margin: 0 auto 24px;
  max-width: 460px;
  font-size: 16.5px;
  color: var(--res-dim);
}

.res-cta__btn {
  padding: 13px 28px;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  color: #ffffff;
  background: var(--res-accent);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.res-cta__btn:hover {
  background: #2558d6;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

.res-footer {
  margin-top: 72px;
  padding: 32px 0 44px;
  border-top: 1px solid var(--res-border);
}

.res-footer__row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}

.res-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-size: 14.5px;
}

.res-footer__nav a {
  color: var(--res-muted);
  text-decoration: none;
}

.res-footer__nav a:hover {
  color: var(--res-accent);
}

.res-footer__legal {
  margin: 22px 0 0;
  font-size: 13px;
  color: var(--res-muted);
}

@media (max-width: 560px) {
  .res-main {
    padding-top: 110px;
  }

  .res-cta {
    padding: 30px 22px;
  }

  .res-card__link {
    padding: 22px;
  }
}
