@layer utilities {
  /* Text */
  .txt-2xs { font-size: var(--text-2xs); }
  .txt-xs { font-size: var(--text-xs); }
  .txt-sm { font-size: var(--text-sm); }
  .txt-base { font-size: var(--text-base); }
  .txt-lg { font-size: var(--text-lg); }
  .txt-xl { font-size: var(--text-xl); }
  .txt-2xl { font-size: var(--text-2xl); }
  .txt-3xl { font-size: var(--text-3xl); }

  .txt-ink { color: var(--color-ink); }
  .txt-subtle { color: var(--color-ink-subtle); }
  .txt-muted { color: var(--color-ink-muted); }
  .txt-link { color: var(--color-link); text-decoration: underline; text-decoration-skip-ink: auto; }
  .txt-white { color: var(--color-white); }
  .txt-positive { color: var(--color-emerald-700); }
  .txt-warning { color: var(--color-amber-700); }
  .txt-danger { color: var(--color-rose-700); }

  .txt-center { text-align: center; }
  .txt-left { text-align: left; }
  .txt-right { text-align: right; }
  .txt-uppercase { text-transform: uppercase; }
  .txt-nowrap { white-space: nowrap; }
  .font-medium { font-weight: 500; }
  .font-semibold { font-weight: 600; }
  .font-bold { font-weight: 700; }
  .font-black { font-weight: 800; }
  .font-mono { font-family: var(--font-mono); }
  .txt-break { word-break: break-all; }
  .txt-preline { white-space: pre-line; }

  /* Layout */
  .flex { display: flex; }
  .flex-inline { display: inline-flex; }
  .flex-column { flex-direction: column; }
  .flex-wrap { flex-wrap: wrap; }
  .flex-nowrap { flex-wrap: nowrap; }
  .items-center { align-items: center; }
  .items-start { align-items: flex-start; }
  .items-end { align-items: flex-end; }
  .self-start { align-self: flex-start; }
  .justify-between { justify-content: space-between; }
  .justify-center { justify-content: center; }
  .justify-end { justify-content: flex-end; }

  .grid { display: grid; }
  .grid-2 { display: grid; gap: var(--block-space); }
  .grid-3 { display: grid; gap: var(--block-space); }
  .block { display: block; }
  .hidden { display: none; }

  .gap { gap: var(--block-space); }
  .gap-xs { gap: var(--block-space-quarter); }
  .gap-sm { gap: var(--block-space-half); }
  .gap-lg { gap: var(--block-space-double); }

  .stack-xs { display: flex; flex-direction: column; gap: var(--block-space-quarter); }
  .stack-sm { display: flex; flex-direction: column; gap: var(--block-space-half); }
  .stack { display: flex; flex-direction: column; gap: var(--block-space); }
  .stack-lg { display: flex; flex-direction: column; gap: var(--block-space-double); }
  .cluster { display: flex; flex-wrap: wrap; gap: var(--block-space); align-items: center; }

  @media (min-width: 768px) {
    .grid-2 {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (min-width: 960px) {
    .grid-3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .span-2 {
      grid-column: span 2;
    }
  }

  /* Spacing */
  .pad { padding: var(--block-space) var(--inline-space); }
  .pad-sm { padding: var(--block-space-half) var(--inline-space-half); }
  .pad-lg { padding: var(--block-space-double) var(--inline-space-double); }
  .pad-block { padding-block: var(--block-space); }
  .pad-inline { padding-inline: var(--inline-space); }
  .pad-inline-lg { padding-inline: var(--inline-space-double); }
  .margin-none { margin: 0; }
  .center { margin-inline: auto; }

  /* Sizing */
  .w-full { inline-size: 100%; }
  .h-full { block-size: 100%; }
  .min-w-0 { min-inline-size: 0; }

  /* Borders */
  .border { border: 1px solid var(--color-border); }
  .border-strong { border: 1px solid var(--color-border-strong); }
  .rounded-sm { border-radius: var(--radius-sm); }
  .rounded-md { border-radius: var(--radius-md); }
  .rounded-lg { border-radius: var(--radius-lg); }
  .rounded-xl { border-radius: var(--radius-xl); }
  .rounded-pill { border-radius: var(--radius-pill); }

  /* Background */
  .bg-canvas { background: var(--color-canvas); }
  .bg-surface { background: var(--color-surface); }
  .bg-ink { background: var(--color-ink); }
  .bg-accent-soft { background: var(--color-accent-soft); }

  /* Shadows */
  .shadow-sm { box-shadow: var(--shadow-sm); }
  .shadow-md { box-shadow: var(--shadow-md); }
  .shadow-lg { box-shadow: var(--shadow-lg); }

  /* Overflow */
  .overflow-hidden { overflow: hidden; }
  .overflow-x-auto { overflow-x: auto; }
  .overflow-y-auto { overflow-y: auto; }

  .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

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

  .list {
    padding-inline-start: 1.25em;
  }

  .list--disc { list-style: disc; }
  .list--decimal { list-style: decimal; }
  .list--inside { list-style-position: inside; }
  .list--stack {
    display: grid;
    gap: var(--block-space-quarter);
  }
}
