:root {
  --color-charcoal: #171b1a;
  --color-fog-green: #3c514a;
  --color-aged-paper: #ede4d0;
  --color-vermilion: #ba5348;
  --color-paper-muted: #d9cfb9;
  --color-ink-muted: #b9c2bb;
  --color-line-dark: #a89e89;

  --color-background: var(--color-charcoal);
  --color-surface: var(--color-aged-paper);
  --color-surface-muted: var(--color-paper-muted);
  --color-text: var(--color-charcoal);
  --color-text-muted: #59635d;
  --color-text-inverse: var(--color-aged-paper);
  --color-border: var(--color-line-dark);
  --color-accent: var(--color-vermilion);
  --color-accent-hover: #994137;
  --color-secondary: var(--color-fog-green);

  --font-body: "Humanist Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: "Narrow Display Serif", "Arial Narrow", "Bodoni Moda", Georgia, serif;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --radius-sm: 0.125rem;
  --radius-md: 0.25rem;
  --shadow-paper: 0 12px 30px rgb(0 0 0 / 0.22);
  --focus-ring: 0 0 0 3px var(--color-vermilion);
}

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

  html {
    background: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 100%;
    line-height: 1.65;
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }

    *,
    ::before,
    ::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      scroll-behavior: auto !important;
      transition-duration: 0.01ms !important;
    }
  }

  body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-body);
    font-weight: 400;
    overflow-wrap: break-word;
    text-rendering: optimizeLegibility;
  }

  main {
    display: block;
  }

  :where(h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd) {
    margin: 0;
  }

  :where(ul, ol) {
    margin: 0;
    padding-left: 1.5em;
  }

  :where(h1, h2, h3, h4, h5, h6) {
    color: inherit;
    font-family: var(--font-heading);
    font-stretch: condensed;
    font-weight: 700;
    line-height: 1.08;
    overflow-wrap: break-word;
    text-wrap: balance;
  }

  h1 {
    font-size: clamp(2.25rem, 6vw, 3.75rem);
  }

  h2 {
    font-size: clamp(1.875rem, 4vw, 3rem);
  }

  h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
  }

  h4 {
    font-size: 1.25rem;
  }

  p,
  li,
  dd {
    overflow-wrap: break-word;
    hyphens: auto;
  }

  p {
  }

  small {
    font-size: 0.75rem;
    line-height: 1.45;
  }

  :where(a) {
    color: inherit;
    text-decoration-color: var(--color-vermilion);
    text-decoration-thickness: 0.1em;
    text-underline-offset: 0.16em;
  }

  :where(a:hover) {
    color: var(--color-vermilion);
    text-decoration-thickness: 0.14em;
  }

  :where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--color-vermilion);
    outline-offset: 3px;
  }

  :where(button, input, select, textarea) {
    margin: 0;
    color: inherit;
    font: inherit;
  }

  :where(button, [type="button"], [type="reset"], [type="submit"]) {
    min-height: 2.75rem;
    cursor: pointer;
  }

  :where(button:disabled, input:disabled, select:disabled, textarea:disabled) {
    cursor: not-allowed;
    opacity: 0.6;
  }

  :where(input, select, textarea) {
    max-width: 100%;
    border: 1px solid var(--color-line-dark);
    border-radius: var(--radius-sm);
    background: var(--color-aged-paper);
    color: var(--color-charcoal);
    padding: 0.625rem 0.75rem;
  }

  :where(textarea) {
    min-height: 8rem;
    resize: vertical;
  }

  :where(label) {
    display: inline-block;
    font-weight: 600;
  }

  :where(fieldset) {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
  }

  :where(legend) {
    padding: 0;
  }

  :where(img, picture, svg, video, canvas, audio, iframe, embed, object) {
    display: block;
    max-width: 100%;
  }

  :where(img, video) {
    height: auto;
  }

  :where(img) {
    border-style: none;
  }

  :where(iframe) {
    border: 0;
  }

  :where(table) {
    width: 100%;
    border-collapse: collapse;
    border-color: var(--color-line-dark);
  }

  :where(th, td) {
    border: 1px solid var(--color-line-dark);
    padding: 0.75rem;
    text-align: left;
    vertical-align: top;
  }

  :where(th) {
    font-weight: 700;
  }

  :where(hr) {
    height: 1px;
    margin: var(--space-8) 0;
    border: 0;
    background: var(--color-line-dark);
    color: inherit;
  }

  :where(code, kbd, samp, pre) {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  }

  :where(code, kbd) {
    overflow-wrap: anywhere;
  }

  :where(pre) {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
  }

  :where([hidden]) {
    display: none !important;
  }

  :where([id]) {
    scroll-margin-top: var(--space-8);
  }

  ::selection {
    background: var(--color-vermilion);
    color: var(--color-aged-paper);
  }
}
