@media (min-width: 600px) {
  :root {
    --font-size-base: 150%;
  }
}

:root {
  color-scheme: light; /* light dark */
}

html {
  font-size: var(--font-size-base, 112.5%);
}

body {
  background: #fafafa;
  color: #131313;
  color: light-dark(#131313, #fafafa);
  background-color: light-dark(#fafafa, #30393f);
  font-display: fallback;
  font-family: "Piazzolla", "firava", system-ui, sans-serif;
  font-weight: 400;
  line-height: 1.5;

  > :is(header, footer, main) {
    margin: 0 auto;
    max-width: 58ch;
    width: 94vw;
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "firava", system-ui, sans-serif;
  font-weight: 550;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0.25rem 0;
}

h2 {
  font-size: 1.375rem;
}

h3 {
  font-size: 1.25rem;
}

h4 {
  font-size: 1.125rem;
}

h5,
h6 {
  font-size: 1rem;
}

pre,
code {
  background-color: light-dark(#eee, #474a4d);
  border-radius: 4px;
  font-family: monospace;
  overflow: hidden;
  white-space: pre-wrap;
}

pre {
  padding: 0.25rem 0.5rem;
}

a {
  color: light-dark(#135caa, #99cdfe);
  text-decoration-color: inherit;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 2px;
  text-underline-offset: max(2px, 0.13em);

  &:hover,
  &:focus-visible {
    text-decoration-style: solid;
  }

  &.sitename {
    font-weight: 600;
  }

  &[aria-current="page"] {
    color: inherit;
  }
}

body > header {
  nav ul {
    display: flex;
    font-family: "firava", system-ui, sans-serif;
    gap: 0 1rem;
    list-style: none;
    padding: 0;
    text-transform: lowercase;
  }
}

body > footer {
  margin-top: 2rem;

  nav ul {
    display: flex;
    gap: 0 1rem;
    list-style: none;
    padding: 0;
  }
}

main article {
  * + * {
    margin-top: 1rem;
  }

  h2 {
    margin-top: 2rem;
  }

  .hero {
    p {
      color: light-dark(#444, #eee);
      font-style: italic;
      font-weight: 500;
      margin: 0;
    }
  }

  ul,
  ol,
  dl {
    padding-inline-start: 1.2rem;

    li + li {
      margin-top: 0.5rem;
    }
  }

  blockquote {
    background-color: light-dark(#eee, #555);
    border-left: 4px dotted #707070;
    font-style: italic;
    margin-left: 0;
    padding: 1rem;

    p {
      margin: 0;
    }
  }
}

/* A11y */

.visually-hidden,
a.skiplink:not(:focus-visible):not(:active),
body > header > nav > h2 {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:is(*, :hover):focus-visible {
  border-radius: 3px;
  outline-color: light-dark(#cc5a00, #ff9900);
  outline-offset: 3px;
  outline-style: solid;
  outline-width: 3px;
  transition: none;
}
