:root {
  --bg: #f7f6f2;
  --text: #161616;
  --muted: #4f4f4a;
  --faint: #5a5a54;
  --rule: #e4e2da;
  --accent: #4a3f35;
  --focus: #4a3f35;
  --measure: 38rem;
}

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

html {
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 10;
  padding: 0.4rem 0.7rem;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: #c8c5bb;
}

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

a:visited {
  color: #3a3a3a;
}

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

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

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

body > header,
main,
footer {
  width: min(100% - 2.5rem, var(--measure));
  margin-inline: auto;
}

body > header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem 1.5rem;
  padding: 2.25rem 0 1.15rem;
  border-bottom: 1px solid var(--rule);
}

.site-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-name a {
  color: var(--text);
  text-decoration: none;
}

.site-name a:hover {
  text-decoration: underline;
  text-decoration-color: var(--text);
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav a {
  color: var(--muted);
  text-decoration: none;
}

nav a:hover,
nav a:focus-visible {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text);
}

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

.intro {
  padding-top: 2.5rem;
}

h1 {
  margin: 0 0 1.15rem;
  max-width: 22em;
  font-size: clamp(1.35rem, 1.15rem + 0.85vw, 1.7rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.intro p {
  margin: 0;
  color: var(--muted);
}

section {
  padding-top: 3rem;
  scroll-margin-top: 1.25rem;
}

h2 {
  margin: 0 0 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--faint);
}

h3 {
  margin: 0;
  font-size: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.entries,
.writing,
.contact {
  margin: 0;
  padding: 0;
  list-style: none;
}

.entries > li + li,
.writing > li + li {
  margin-top: 1.35rem;
}

.entries p,
.writing p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

#about p {
  margin: 0 0 0.9rem;
  color: var(--muted);
}

#about p:last-child {
  margin-bottom: 0;
}

.contact-lead {
  margin: 0 0 1.15rem;
  font-weight: 600;
}

.contact li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.85rem;
  padding: 0.45rem 0;
}

.contact li + li {
  border-top: 1px solid var(--rule);
}

.contact-label {
  flex: 0 0 5.5rem;
  color: var(--muted);
}

footer {
  padding: 3.5rem 0 3rem;
  color: var(--faint);
  font-size: 0.9rem;
}

footer p {
  margin: 0;
}

@media (max-width: 36rem) {
  body > header,
  main,
  footer {
    width: min(100% - 2rem, var(--measure));
  }

  body > header {
    padding-top: 1.5rem;
  }

  .intro {
    padding-top: 1.85rem;
  }

  section {
    padding-top: 2.5rem;
  }

  .contact-label {
    flex-basis: 100%;
  }
}
