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

  html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
  }

  body {
    margin: 0;
    background-color: var(--c-paper);
    color: var(--c-ink);
    font-family: var(--f-body);
    font-size: var(--fs-body);
    line-height: var(--lh-body);
    font-synthesis-weight: none;
    text-rendering: optimizeLegibility;
    /* newsprint tooth: a very low-amplitude turbulence plate, generated, not fetched */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    background-repeat: repeat;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-family: var(--f-display);
    font-weight: 700;
    line-height: var(--lh-head);
    margin: 0 0 var(--s-3);
    text-wrap: balance;
    letter-spacing: -0.011em;
  }

  h1 {
    font-size: var(--fs-h1);
    line-height: var(--lh-tight);
    font-stretch: 88%;
    letter-spacing: -0.018em;
  }
  h2 {
    font-size: var(--fs-h2);
    font-stretch: 92%;
  }
  h3 {
    font-size: var(--fs-h3);
  }
  h4 {
    font-size: 1.0625rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
  }

  p,
  ul,
  ol,
  dl,
  figure,
  table,
  blockquote {
    margin: 0 0 var(--s-4);
  }

  p {
    text-wrap: pretty;
  }

  a {
    color: var(--c-primary-ink);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
  }
  a:hover {
    text-decoration-thickness: 2px;
  }

  :focus-visible {
    outline: 3px solid var(--c-focus);
    outline-offset: 2px;
    border-radius: 1px;
  }
  /* Never remove the indicator without replacing it. */
  :focus:not(:focus-visible) {
    outline: none;
  }

  strong,
  b {
    font-weight: 650;
  }

  small {
    font-size: var(--fs-small);
  }

  code,
  kbd,
  samp {
    font-family: var(--f-mono);
    font-size: 0.92em;
  }

  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-inline-size: 100%;
    height: auto;
  }

  hr {
    border: 0;
    border-top: var(--hairline);
    margin: var(--s-6) 0;
  }

  table {
    border-collapse: collapse;
    inline-size: 100%;
    font-variant-numeric: tabular-nums;
  }
  th,
  td {
    text-align: start;
    padding: var(--s-2) var(--s-3);
    border-block-end: var(--hairline);
  }
  th {
    font-family: var(--f-display);
    font-size: var(--fs-small);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 600;
    color: var(--c-ink-muted);
  }

  fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-inline-size: 0;
  }
  legend {
    padding: 0;
  }

  button,
  input,
  select,
  textarea {
    font: inherit;
    color: inherit;
  }

  ::selection {
    background: var(--c-primary);
    color: var(--c-ink);
  }

  /* --- helpers ---------------------------------------------------------- */
  .visually-hidden {
    position: absolute !important;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .skip-link {
    position: absolute;
    inset-inline-start: var(--s-4);
    inset-block-start: -100%;
    z-index: 999;
    background: var(--c-ink);
    color: var(--c-ink-inverse);
    padding: var(--s-3) var(--s-4);
    font-family: var(--f-display);
    font-weight: 600;
    text-decoration: none;
  }
  .skip-link:focus {
    inset-block-start: var(--s-2);
  }

  .num {
    font-family: var(--f-mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
    /* A long unbreakable monospace run (a code, a citation, a formula) would
       otherwise widen its parent past the viewport at 320px. break-word only
       breaks when the word cannot fit on a line of its own. */
    overflow-wrap: break-word;
  }

  /* A URL or a long citation printed as running text is the other way a page
     gets pushed sideways. break-word only splits a word that cannot fit alone. */
  p,
  li,
  dd,
  dt,
  td,
  th,
  figcaption,
  code,
  kbd,
  samp {
    overflow-wrap: break-word;
  }

  /* A grid or flex child defaults to a min-content floor, which is how a wide
     child pushes a whole page sideways. */
  main,
  .prose,
  .account-main {
    min-inline-size: 0;
  }

  [hidden] {
    display: none !important;
  }

  @media (prefers-reduced-motion: reduce) {
    html {
      scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
}
