:root {
  color-scheme: light;
  --background: #fdfdfc;
  --text: #17181b;
  --muted: #6f7075;
  --line: #dedfdf;
  --accent: #284fc7;
  --selection: #dbe3ff;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #181815;
  --text: #f0eee8;
  --muted: #9e9b92;
  --line: #383731;
  --accent: #8fa9ff;
  --selection: #34457c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.48;
  transition: background-color 180ms ease, color 180ms ease;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

.site-header,
main,
footer {
  width: min(100% - 40px, 660px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 40px;
}

.home-link {
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
}

.theme-toggle {
  display: grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--accent);
}

.theme-toggle:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.theme-toggle svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.moon,
:root[data-theme="dark"] .sun {
  display: none;
}

:root[data-theme="dark"] .moon {
  display: block;
}

main {
  padding-top: clamp(76px, 13vh, 132px);
}

.intro {
  max-width: 680px;
}

h1 {
  margin: 0 0 30px;
  font-size: 1.52rem;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.lede {
  max-width: 650px;
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.015em;
  line-height: 1.52;
}

.lede a {
  color: var(--accent);
}

.work {
  margin-top: 40px;
}

.work-item {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 0;
  align-items: start;
  padding-top: 4px;
}

.work-item time {
  max-width: 78px;
  color: var(--muted);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.work-item h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.work-item cite {
  font-style: normal;
}

.work-item p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: baseline;
  padding-top: clamp(100px, 16vh, 180px);
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 0.84rem;
}

footer nav {
  display: flex;
  gap: 18px;
}

.copyright {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 620px) {
  .site-header,
  main,
  footer {
    width: min(100% - 32px, 660px);
  }

  .site-header {
    padding-top: 22px;
  }

  main {
    padding-top: 72px;
  }

  footer {
    padding-top: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
