@layer base {
  body {
    font-family: var(--font-family-body);
    font-size: var(--font-size-body);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  a {
    color: var(--color-primary);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
  }

  a:hover {
    color: var(--color-primary-hover);
  }

  :focus-visible {
    outline: 2px solid color-mix(in srgb, var(--color-primary), transparent 30%);
    outline-offset: 2px;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-family: var(--font-family-heading);
    line-height: var(--line-height-tight);
    margin: 0 0 var(--space-4);
    letter-spacing: var(--letter-spacing-tight);
    text-transform: uppercase;
    font-weight: var(--font-weight-regular);
    color: var(--color-text);
  }

  h1 {
    font-size: var(--font-size-h1);
  }

  h2 {
    font-size: var(--font-size-h2);
  }

  h3 {
    font-size: var(--font-size-h3);
  }

  h4 {
    font-size: var(--font-size-h4);
  }

  h5 {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-medium);
  }

  h6 {
    font-size: var(--text-base);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
  }

  p {
    margin: 0 0 var(--space-4);
    overflow-wrap: break-word;
  }

  p:last-child {
    margin-bottom: 0;
  }

  small,
  .text-small {
    font-size: var(--font-size-small);
    color: var(--color-muted);
  }

  .text-lead,
  .lead {
    font-size: var(--text-lg);
    line-height: var(--line-height-relaxed);
    color: var(--color-muted);
  }

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

  blockquote {
    margin: 0 0 var(--space-6);
    padding: var(--space-4) var(--space-6);
    border-inline-start: 4px solid var(--color-primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: var(--text-lg);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-snug);
    color: var(--color-blue-800);
    background: var(--onepager-section-bg-alt);
  }

  code,
  kbd {
    font-family: var(--font-family-mono);
    font-size: 0.9em;
  }

  pre {
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    font-family: var(--font-family-mono);
    font-size: var(--font-size-small);
    overflow-x: auto;
    background: var(--color-blue-50);
  }
}

@layer utilities {
  .section-heading,
  .page-title {
    max-width: 20ch;
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    text-transform: uppercase;
  }

  .section-heading--large {
    font-size: var(--text-5xl);
    max-width: 14ch;
  }

  .text-muted {
    color: var(--color-muted);
  }

  .text-accent {
    color: var(--color-primary);
  }
}

/* Prose / RTE */
.content-flow,
.prose {
  --flow-space: var(--flow-space);
}

.content-flow > * + *,
.prose > * + * {
  margin-block-start: var(--flow-space);
}

.content-flow :where(p, ul, ol, dl),
.prose :where(p, ul, ol, dl) {
  color: var(--color-muted);
  max-width: 65ch;
}

.content-flow :where(h1, h2, h3, h4),
.prose :where(h1, h2, h3, h4) {
  max-width: 22ch;
  color: var(--color-text);
}

.content-flow :where(h1 + p, h2 + p, h3 + p),
.prose :where(h1 + p, h2 + p, h3 + p) {
  margin-block-start: var(--stack-space);
}

.content-flow :where(ul, ol),
.prose :where(ul, ol) {
  padding-inline-start: 1.35em;
}

.content-flow :where(li + li),
.prose :where(li + li) {
  margin-block-start: 0.35em;
}

.content-flow :where(a),
.prose :where(a) {
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
}

.content-flow :where(img, video, iframe),
.prose :where(img, video, iframe) {
  max-width: 100%;
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-sm);
}

.ce-shell--bg-contrast :where(h1, h2, h3, h4, h5, h6, p, li),
.cb-frame--bg-dark :where(h1, h2, h3, h4, h5, h6, p, li),
.cb-text--light :where(h1, h2, h3, h4, h5, h6, p, li),
.cb-text--dark :where(h1, h2, h3, h4, h5, h6, p, li) {
  color: inherit;
}
