:root {
  color-scheme: light;
  --font-family: "Alegreya", Georgia, serif;
  --font-family-display: "Alegreya SC", serif;
  --font-family-code: "Courier Prime", monospace;
  --line-height: 1.2rem;
  --border-thickness: 1.5px;
  --text-color: #000;
  --background-color: #fff;
  --link-color: #6b6b6b;
  --horizontal-margin: 3ch;
  --body-inner-width: 66ch;
  --body-max-width: calc(var(--body-inner-width) + var(--horizontal-margin) * 2);
  --font-weight-normal: 450;
  --font-weight-medium: 600;
  --font-weight-bold: 800;
  font-family: var(--font-family);
  font-optical-sizing: auto;
  font-size: 16px;
  font-style: normal;
  font-variant-numeric: oldstyle-nums;
  font-feature-settings: "onum";
  font-weight: var(--font-weight-normal);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --text-color: #e8e6df;
  --background-color: #171717;
  --link-color: #8f8b82;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  margin: 0;
  color: var(--text-color);
  background: var(--background-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  width: 100%;
  min-height: 100vh;
  max-width: var(--body-max-width);
  margin: 0 auto;
  padding: var(--line-height) var(--horizontal-margin);
  overflow-x: hidden;
  color: var(--text-color);
  background: var(--background-color);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height);
  transition: background-color 180ms ease-out, color 180ms ease-out;
}

::selection {
  color: var(--background-color);
  background: var(--text-color);
}

a:link,
a:visited {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  color: var(--text-color);
}

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

.container,
.site-nav {
  width: 100%;
  margin-right: 0;
  margin-left: 0;
}

.site-nav {
  display: flex;
  margin: var(--line-height) 0 calc(var(--line-height) * 2);
  align-items: center;
  gap: 1.5rem;
}

.site-identity-row {
  justify-content: space-between;
  gap: var(--line-height);
}

.site-nav-links {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
}

.site-nav .site-nav-item,
.nav-bottom a,
.not-found a {
  color: var(--link-color);
  font-family: var(--font-family-display);
  font-size: 1.125rem;
  font-variant: all-small-caps;
  font-weight: 500;
  letter-spacing: 0.075em;
}

.profile-header {
  margin: calc(var(--line-height) * 2) 0;
}

h1 {
  margin: 0;
  font-family: var(--font-family-display);
  font-size: 2.5rem;
  font-variant: all-small-caps;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: calc(var(--line-height) * 2);
  text-wrap: balance;
}

.social-icons {
  display: flex;
  margin-top: var(--line-height);
  margin-left: -0.45rem;
  align-items: center;
  gap: 0.125rem;
}

.social-icons a {
  display: grid;
  color: var(--text-color);
  width: 2rem;
  height: 2rem;
  padding: 0.45rem;
  border: var(--border-thickness) solid transparent;
  border-radius: 50%;
  place-items: center;
  text-decoration: none;
  transition: background-color 140ms ease-out, color 140ms ease-out, border-color 140ms ease-out, transform 140ms ease-out;
}

.social-icons a:hover,
.social-icons a:focus-visible {
  color: var(--background-color);
  background: var(--text-color);
  border-color: var(--text-color);
}

.social-icons a:active,
.theme-toggle:active {
  transform: scale(0.94);
}

.social-icons svg {
  display: block;
  width: 100%;
  height: 100%;
}

.about-copy {
  max-width: var(--body-inner-width);
}

.about-copy p {
  margin: 0;
  hyphens: auto;
  text-align: justify;
  text-wrap: pretty;
}

.about-copy p + p {
  margin-top: 0;
  text-indent: 3ch;
}

.nav-bottom {
  margin-top: calc(var(--line-height) * 3);
}

.theme-toggle {
  display: inline-grid;
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0.5rem;
  color: var(--text-color);
  background: none;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  line-height: 1;
  opacity: 0.6;
  place-items: center;
  transition: opacity 180ms ease-out;
}

.theme-toggle:hover {
  color: var(--text-color);
  background: none;
  opacity: 1;
}

.theme-toggle:active {
  transform: none;
}

.theme-icon {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  transition: opacity 180ms ease-out, filter 180ms ease-out, transform 180ms ease-out;
}

.theme-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.theme-icon-sun,
:root[data-theme="dark"] .theme-icon-moon {
  opacity: 0;
  filter: blur(3px);
  transform: scale(0.3);
}

.theme-icon-moon,
:root[data-theme="dark"] .theme-icon-sun {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}

.not-found {
  display: flex;
  min-height: calc(100vh - var(--line-height) * 2);
  margin: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--line-height);
}

.not-found h1 {
  padding: var(--line-height) 0 calc(var(--line-height) - var(--border-thickness));
  border-bottom: var(--border-thickness) solid var(--text-color);
}

@media (max-width: 480px) {
  :root {
    --horizontal-margin: 1.5ch;
    font-size: 14px;
  }

}

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

@media print {
  :root,
  :root[data-theme="dark"] {
    color-scheme: light;
    --text-color: #000;
    --background-color: #fff;
  }

  .site-nav,
  .nav-bottom,
  .theme-toggle {
    display: none;
  }
}
