/* Base Styles
 * Typography, body defaults, headings, links, basic elements.
 * Uses color tokens from colors.css.
 */

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  color: var(--color-ink);
  background: var(--color-canvas);
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 600;
}

h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
h2 { font-size: clamp(1.375rem, 2.5vw, 1.75rem); }
h3 { font-size: clamp(1.125rem, 2vw, 1.375rem); }

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 0.15em;

  &:hover {
    text-decoration-thickness: 2px;
  }

  &:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
    border-radius: 2px;
  }
}

p + p {
  margin-block-start: var(--block-space);
}

code, pre {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

pre {
  padding: var(--block-space) var(--inline-space);
  background: var(--color-surface);
  border-radius: 6px;
  overflow-x: auto;
}

code:not(pre code) {
  padding: 0.15em 0.35em;
  background: var(--color-surface);
  border-radius: 3px;
}

hr {
  border: none;
  border-block-start: 1px solid var(--color-border);
  margin-block: var(--block-space-l);
}

/* Semantic breakpoints: "room for 100 characters?" */
@media (min-width: 100ch) {
  body {
    font-size: 1.0625rem;
  }
}
