:root {
  color-scheme: light;
  --bg: #fbfbfb;
  --surface: #f2f2f1;
  --text: #181817;
  --text-muted: #6b6b68;
  --rule: #e7e7e5;
  --underline: #c8c8c4;
  --underline-hover: #181817;
  --dot: #181817;
  --selection: #ebebea;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141413;
  --surface: #1e1d1b;
  --text: #eae8e1;
  --text-muted: #96938b;
  --rule: #282724;
  --underline: #47453f;
  --underline-hover: #eae8e1;
  --dot: #eae8e1;
  --selection: #2d2c28;
}

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

html {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 180ms ease, color 180ms ease;
}

body {
  margin: 0;
  min-height: 100vh;
}

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

.page {
  width: 100%;
  max-width: 39rem;
  margin: 0 auto;
  padding: clamp(4.5rem, 13vh, 8.5rem) 1.5rem 5rem;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
  transition: border-color 180ms ease;
}

.name {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.theme-toggle {
  appearance: none;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  color: var(--text-muted);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--underline);
  background-color: var(--surface);
}

.theme-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--dot);
  transition: background-color 180ms ease;
}

.prose p {
  margin: 0 0 1.25rem;
  font-size: 1.12rem;
  color: var(--text);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose a,
.contact a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--underline);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: text-decoration-color 150ms ease, color 150ms ease;
}

.prose a:hover,
.contact a:hover {
  text-decoration-color: var(--underline-hover);
}

.contact {
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.9rem 1.5rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.84rem;
  transition: border-color 180ms ease;
}

.socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.15rem;
}

.arrow {
  display: inline-block;
  margin-left: 0.15rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  transition: transform 150ms ease, color 150ms ease;
}

.socials a:hover .arrow {
  color: var(--text);
  transform: translate(1px, -1px);
}

@media (max-width: 520px) {
  html {
    font-size: 17px;
  }

  .page {
    padding-top: 3.25rem;
  }

  .contact {
    flex-direction: column;
    align-items: flex-start;
  }
}
