:root {
  --bg: #fcf7f1;
  --ink: #1f1d1a;
  --muted: #8a847b;
  --rule: #e6ded3;
  --link: #3d5a3a;
  --link-hover: #8a5a7a;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body.site-page {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

body.home-page,
body.art-page {
  font-size: 17px;
  line-height: 1.65;
}

.page {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.vine {
  position: absolute;
  top: 70px;
  width: 170px;
  height: 520px;
  pointer-events: none;
  z-index: 0;
}

.vine.left {
  left: 0;
  transform-origin: bottom center;
  animation: sway 4.4s ease-in-out infinite;
}

.vine.right {
  right: 0;
  transform-origin: bottom center;
  animation: sway-right 5.2s ease-in-out infinite;
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(-1.6deg) translateY(0);
  }
  50% {
    transform: rotate(1.6deg) translateY(-2px);
  }
}

@keyframes sway-right {
  0%,
  100% {
    transform: scaleX(-1) rotate(1.4deg) translateY(0);
  }
  50% {
    transform: scaleX(-1) rotate(-1.4deg) translateY(-2px);
  }
}

.home-main,
.site-lead,
.art-main,
.text-col {
  position: relative;
  z-index: 1;
}

.home-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 96px 0;
}

.site-lead {
  max-width: 720px;
  margin: 0 auto;
  padding: 96px 0 0;
}

.home-main > h1,
.page .site-name {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.15;
  margin: 0 0 12px;
  color: var(--ink);
}

.home-main > h1.typewriter {
  width: max-content;
  max-width: 100%;
}

.home-main > h1.typewriter > span {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  vertical-align: bottom;
  max-width: 0;
  border-right: 0.08em solid currentColor;
  animation: typing 4s steps(18, end) forwards, caret 0.77s step-end infinite;
}

@keyframes typing {
  from {
    max-width: 0;
  }
  to {
    max-width: 16em;
  }
}

@keyframes caret {
  50% {
    border-color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vine.left,
  .vine.right {
    animation: none;
  }

  .vine.right {
    transform: scaleX(-1);
  }

  .home-main > h1.typewriter > span {
    max-width: none;
    border-right: 0;
    animation: none;
  }
}

.home-page a:link,
.home-page a:visited {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(61, 90, 58, 0.45);
}

.home-page a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 16px;
  margin-bottom: 40px;
}

.page .contact a:link,
.page .contact a:visited {
  color: var(--ink);
  text-decoration-color: var(--rule);
}

.page .contact a:hover {
  color: var(--link-hover);
}

nav.sections {
  display: block;
  max-width: 100%;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 30px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 12px;
}

nav.sections button,
nav.sections a {
  all: unset;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 0;
  display: inline-block;
  margin: 0;
  font-family: var(--sans);
  font-size: inherit;
  font-weight: 600;
  line-height: inherit;
  text-decoration: none;
  white-space: nowrap;
}

nav.sections a:link,
nav.sections a:visited,
nav.sections button {
  color: var(--muted);
  text-decoration: none;
}

nav.sections a:not(:first-child) {
  margin-left: 0;
}

nav.sections button:hover,
nav.sections a:hover {
  color: var(--ink);
  text-decoration: none;
}

nav.sections button[aria-selected="true"],
nav.sections a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--link);
}

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

nav.sections .sep {
  color: var(--rule);
  margin: 0 9px;
}

.home-page section[hidden] {
  display: none;
}

.home-page p {
  margin: 0 0 16px;
}

.entry {
  margin-bottom: 28px;
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.entry-title {
  font-weight: 600;
}

.entry-meta {
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
}

.entry p {
  margin: 4px 0 0;
}

.entry ul {
  margin: 6px 0 0;
  padding-left: 22px;
}

.home-page h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 17px;
  margin: 32px 0 10px;
  color: var(--ink);
}

.home-page h3.first {
  margin-top: 0;
}

.home-page h3 .aside {
  font-weight: 400;
  color: var(--muted);
}

ul.earlier {
  margin: 0;
  padding-left: 20px;
}

ul.earlier li {
  margin-bottom: 12px;
}

.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
}

.cols h4 {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 4px;
}

.cols ul {
  margin: 0;
  padding-left: 20px;
}

.cols li {
  padding: 1px 0;
}

.code {
  font-variant-numeric: tabular-nums;
}

.pub {
  margin: 8px 0 0;
  padding-left: 16px;
  border-left: 2px solid var(--rule);
}

.pub .authors {
  color: var(--muted);
}

.me {
  color: var(--ink);
  font-weight: 600;
}

.writing-page .page,
.projects-page .page {
  padding-left: 0;
  padding-right: 0;
}

.writing-page .site-lead,
.projects-page .site-lead {
  padding-left: 24px;
  padding-right: 24px;
}

.writing-page .writing-container,
.post-page .article-page {
  padding-top: 12px;
}

.projects-page .projects-hero {
  padding-top: 8px;
}

@media (max-width: 1100px) {
  .vine {
    opacity: 0.35;
  }
}

@media (max-width: 820px) {
  .vine {
    display: none;
  }

  .home-main,
  .site-lead,
  .art-main {
    padding-top: 56px;
  }

  .home-main > h1,
  .page .site-name {
    font-size: 32px;
  }

  body.home-page,
  body.art-page {
    font-size: 16px;
  }

  nav.sections {
    font-size: 16px;
  }

  nav.sections .sep {
    margin: 0 5px;
  }
}

@media (max-width: 520px) {
  .cols {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}
