:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #646464;
  --faint: #e7e7e7;
  --link-line: #b8b8b8;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111111;
  --text: #f2f2f2;
  --muted: #a6a6a6;
  --faint: #2d2d2d;
  --link-line: #666666;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 160ms ease, color 160ms ease;
}

a {
  color: var(--text);
  text-decoration-color: var(--link-line);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

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

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  transform: translateY(-140%);
  z-index: 20;
  background: var(--text);
  color: var(--bg);
  padding: 8px 12px;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header,
.site-footer,
.page {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0 18px;
  border-bottom: 1px solid var(--faint);
}

.brand {
  font-weight: 650;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

nav a {
  color: inherit;
  text-decoration: none;
}

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

.theme-toggle {
  display: inline-flex;
  align-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

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

.toggle-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 36px;
  height: 20px;
  border: 1px solid var(--muted);
  border-radius: 999px;
  background: transparent;
  transition: border-color 160ms ease, background 160ms ease;
}

.toggle-thumb {
  position: absolute;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.theme-toggle:hover .toggle-track {
  border-color: var(--text);
}

.theme-toggle:hover .toggle-thumb {
  background: var(--text);
}

.theme-toggle[aria-pressed="true"] .toggle-track {
  background: var(--text);
  border-color: var(--text);
}

.theme-toggle[aria-pressed="true"] .toggle-thumb {
  background: var(--bg);
  transform: translateX(16px);
}

.page {
  padding: 64px 0 48px;
}

section {
  padding: 54px 0;
  border-bottom: 1px solid var(--faint);
  scroll-margin-top: 24px;
}

.intro {
  padding-top: 0;
}

.avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  filter: grayscale(1);
  margin-bottom: 24px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: 42px;
  line-height: 1.12;
  font-weight: 700;
}

h2 {
  margin-bottom: 26px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 700;
}

h3 {
  margin-bottom: 4px;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
}

p {
  color: var(--muted);
}

.lead {
  color: var(--text);
  font-size: 22px;
  line-height: 1.45;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 28px;
}

.links a {
  color: var(--text);
}

.entry {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 28px;
  padding: 24px 0;
  border-top: 1px solid var(--faint);
}

.entry:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.entry-meta {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.role {
  margin-bottom: 10px;
  color: var(--text);
}

.project {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 24px 0;
  border-top: 1px solid var(--faint);
}

.project:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.project img {
  width: 92px;
  height: 68px;
  border: 1px solid var(--faint);
  object-fit: cover;
  filter: grayscale(1);
}

:root[data-theme="dark"] .avatar,
:root[data-theme="dark"] .project img {
  opacity: 0.86;
}

.project.no-image {
  display: block;
  padding-left: 114px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 42px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  nav {
    justify-content: flex-start;
  }

  .page {
    padding-top: 44px;
  }

  section {
    padding: 44px 0;
  }

  h1 {
    font-size: 36px;
  }

  .lead {
    font-size: 20px;
  }

  .entry,
  .project {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .entry-meta {
    margin-bottom: -2px;
  }

  .project img {
    width: 100%;
    height: auto;
    max-height: 160px;
    object-fit: contain;
  }

  .project.no-image {
    padding-left: 0;
  }

  .site-footer {
    flex-direction: column;
  }
}
