@layer base {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  @media (prefers-reduced-motion: no-preference) {
    @view-transition {
      navigation: auto;
    }

    html {
      scroll-behavior: smooth;
    }
  }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
  }

  body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  main {
    flex: 1 0 auto;
  }

  h1, h2, h3, h4 {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--ink);
    letter-spacing: -0.025em;
    line-height: 1.18;
    text-wrap: balance;
  }

  p {
    margin: 0;
    text-wrap: pretty;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  img, svg {
    display: block;
    max-width: 100%;
  }

  button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
  }

  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 3px;
  }

  ::selection {
    background-color: var(--accent-soft);
    color: var(--ink);
  }

  .skip-link {
    position: absolute;
    left: -9999px;
    top: 0.75rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    background-color: var(--accent);
    color: var(--accent-ink);
    font-size: var(--text-sm);
    font-weight: 600;
  }

  .skip-link:focus {
    left: 1rem;
  }

  /* Long-form Prose (Insights Essays & Legal Pages) */
  .prose {
    max-width: 66ch;
    font-size: var(--text-base);
    line-height: 1.78;
    color: var(--ink);
  }

  .prose > * + * {
    margin-top: 1.35rem;
  }

  .prose h2 {
    margin-top: 2.75rem;
    margin-bottom: 0.75rem;
    font-size: var(--text-2xl);
    font-weight: 700;
    scroll-margin-top: 5.5rem;
  }

  .prose h3 {
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    font-size: var(--text-xl);
    font-weight: 700;
    scroll-margin-top: 5.5rem;
  }

  .prose p,
  .prose li {
    color: var(--ink);
  }

  .prose ul,
  .prose ol {
    padding-left: 1.35rem;
  }

  .prose ul {
    list-style: disc;
  }

  .prose ol {
    list-style: decimal;
  }

  .prose li + li {
    margin-top: 0.45rem;
  }

  .prose li::marker {
    color: var(--accent);
  }

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

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

  .prose strong {
    font-weight: 700;
    color: var(--ink);
  }

  .prose code {
    font-family: var(--font-mono);
    font-size: 0.86em;
    padding: 0.15em 0.38em;
    border-radius: 4px;
    background-color: var(--code-bg);
    border: 1px solid var(--border);
  }

  .prose pre {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.15rem 1.25rem;
    border-radius: var(--radius-md);
    background-color: var(--code-bg);
    border: 1px solid var(--border);
    overflow-x: auto;
    line-height: 1.55;
  }

  .prose pre code {
    padding: 0;
    border: none;
    background: transparent;
    font-size: var(--text-xs);
  }

  .prose blockquote,
  .prose .callout {
    margin: 1.75rem 0;
    padding: 1.25rem 1.4rem;
    border-left: 3px solid var(--accent);
    background-color: var(--accent-soft);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
  }

  .prose .callout-title {
    display: block;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 0.35rem;
  }

  .prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
    margin: 1.75rem 0;
  }

  .prose th,
  .prose td {
    text-align: left;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
  }

  .prose th {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
  }
}
