/* ── Typography component ─────────────────────────────────────── */

@layer components {
  /* ── Headings ────────────────────────────────────────────── */
  .h1 {
    scroll-margin-top: 5rem;
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    text-wrap: balance;
    color: var(--foreground);
  }

  .h2 {
    scroll-margin-top: 5rem;
    font-size: 1.875rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
    text-wrap: balance;
    color: var(--foreground);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;

    &:first-child { margin-top: 0; }
  }

  .h3 {
    scroll-margin-top: 5rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--foreground);
  }

  .h4 {
    scroll-margin-top: 5rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--foreground);
  }

  /* ── Paragraph ───────────────────────────────────────────── */
  .p {
    line-height: 1.75;
    color: var(--foreground);

    &:not(:first-child) { margin-top: 1.5rem; }
  }

  /* ── Lead ─────────────────────────────────────────────────── */
  .lead {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--muted-foreground);
  }

  /* ── Large ────────────────────────────────────────────────── */
  .large {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--foreground);
  }

  /* ── Small ────────────────────────────────────────────────── */
  .small {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    color: var(--foreground);
  }

  /* ── Muted ────────────────────────────────────────────────── */
  .muted {
    font-size: 0.875rem;
    color: var(--muted-foreground);
  }

  /* ── Blockquote ───────────────────────────────────────────── */
  .blockquote {
    margin-top: 1.5rem;
    border-left: 2px solid var(--border);
    padding-left: 1.5rem;
    font-style: italic;
    color: var(--foreground);

    & p { margin: 0; }
  }

  /* ── Inline code ──────────────────────────────────────────── */
  .code {
    position: relative;
    border-radius: var(--radius-sm);
    background: var(--muted);
    padding: 0.125rem 0.375rem;
    font-family: var(--font-mono);
    font-size: 0.8125em;
    font-weight: 600;
    color: var(--foreground);
    border: 1px solid var(--border);
  }

  /* ── List ──────────────────────────────────────────────────── */
  .list {
    margin: 1.5rem 0;
    margin-left: 1.5rem;
    list-style: disc;
    color: var(--foreground);

    & > li { margin-top: 0.5rem; }
  }
}
