:root {
  --background: #faf9f5;
  --text: #282622;
  --muted: #68645d;
  --subtle: #918c82;
  --surface: #efede6;
  --surface-raised: #efede6;
  --surface-hover: #e7e3da;
  --code-background: #f1eee7;
  --link: #0757b8;
  --visited: #4f46a5;
  --line: #ddd8ce;
  --line-strong: #c8c1b5;
  --green: #397047;
  --amber: #8a641a;
  --red: #a33d35;
  --font: Georgia, "Times New Roman", Times, serif;
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

html[data-theme="dark"] {
  --background: #0a0a0a;
  --text: #e9e7e1;
  --muted: #aaa69f;
  --subtle: #77736d;
  --surface: #1d1d1c;
  --surface-raised: #1d1d1c;
  --surface-hover: #272725;
  --code-background: #181817;
  --link: #8cb8f2;
  --visited: #b6a9ef;
  --line: #343330;
  --line-strong: #4a4844;
  --green: #8fc99a;
  --amber: #d2b16f;
  --red: #e1938c;
  color-scheme: dark;
}

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

html {
  min-height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.52;
  transition: background-color 160ms ease, color 160ms ease;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 0.055em;
  text-underline-offset: 0.12em;
  transition: color 120ms ease;
}

a:visited {
  color: var(--visited);
}

a:hover {
  color: var(--link);
  text-decoration-thickness: 0.09em;
}

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

button {
  color: inherit;
}

code,
pre {
  font-family: var(--mono);
}

::selection {
  background: #d9e8fb;
  color: #152b43;
}

html[data-theme="dark"] ::selection {
  background: #294f78;
  color: #f7f5ef;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
}

.theme-toggle {
  display: inline-grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}

.theme-toggle:hover {
  border-color: var(--link);
  transform: translateY(-1px);
}

.theme-toggle img {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  object-position: 50% 31%;
  transform: scale(1.38);
}

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