:root {
  --bg: #fffdf9;
  --text: #171512;
  --muted: #64605b;
  --faint: #908981;
  --line: rgba(23, 21, 18, 0.12);
  --link: #315a9a;
  --max: 680px;
  --wide: 940px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}

.home-page {
  overflow: hidden;
}

.petal-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.petal {
  position: absolute;
  width: 10px;
  height: 10px;
  background: rgba(235, 152, 191, 0.72);
}

.projects-page {
  position: relative;
}

.projects-orbit-field {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 0;
}

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

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

img {
  max-width: 100%;
  display: block;
}

.page {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 28px 28px 88px;
  position: relative;
  z-index: 1;
}

.home-page .page {
  max-width: 1280px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 82px;
}

.site-name {
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-size: 16px;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

.main-column {
  max-width: var(--max);
}

.home-page .main-column {
  max-width: 560px;
  margin-left: -68px;
}

.home-layout {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 8px;
  flex: 1;
  overflow: visible;
}

.home-tree-left-stage {
  position: relative;
  flex: 0 0 250px;
  overflow: visible;
}

.tree-left-canvas {
  position: absolute;
  left: -180px;
  bottom: -118px;
  width: 430px;
  height: 500px;
  display: block;
  pointer-events: none;
}

.home-tree-stage {
  position: relative;
  flex: 1 1 420px;
  align-self: stretch;
  overflow: visible;
}

.home-trees-desktop {
  position: absolute;
  right: -92px;
  bottom: -138px;
  width: 760px;
  height: 760px;
  overflow: visible;
  pointer-events: none;
}

.tree-canvas {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  overflow: visible;
  pointer-events: none;
  width: 760px;
  height: 760px;
}

.tree-foreground {
  z-index: 2;
  transform: translateX(154px);
}

.home-tree-mobile {
  display: none;
}

.intro {
  margin-bottom: 72px;
}

.intro h1,
.page-title {
  margin: 0 0 18px;
  font-size: clamp(34px, 5.8vw, 52px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.025em;
}

.home-page .intro h1 {
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 18px;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.intro p,
.lede {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.72;
}

.lede + .lede,
.essay-body p + p {
  margin-top: 24px;
}

.section {
  margin-top: 80px;
}

.home-page .section {
  margin-top: 0;
}

.home-about {
  margin-top: 28px;
}

.home-page .meta-list {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: 118px;
  flex-wrap: nowrap;
}

.home-page .footer {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.section-label {
  margin: 0 0 16px;
  color: var(--faint);
  font-size: 16px;
  font-weight: 400;
}

.section-copy {
  margin: 0 0 24px;
  color: var(--muted);
}

.index-list,
.meta-list,
.book-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.index-list li + li,
.book-list li + li {
  margin-top: 18px;
}

.index-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.index-link:hover .index-title,
.index-link:hover .book-title {
  color: var(--link);
}

.index-title,
.book-title {
  display: inline;
  font-size: 26px;
  font-weight: 400;
  color: var(--text);
  transition: color 0.15s ease;
}

.index-meta,
.book-meta {
  margin-top: 4px;
  color: var(--faint);
  font-size: 16px;
}

.index-summary,
.book-note {
  margin-top: 6px;
  color: var(--muted);
}

.essay-header {
  margin-bottom: 56px;
}

.essay-meta {
  margin: 14px 0 0;
  color: var(--faint);
  font-size: 16px;
}

.essay-body {
  font-size: 22px;
  line-height: 1.95;
}

.essay-body h2 {
  margin: 64px 0 18px;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
}

.essay-body blockquote {
  margin: 36px 0;
  padding-left: 20px;
  border-left: 1px solid var(--line);
  color: var(--muted);
}

.essay-body ul {
  margin: 24px 0;
  padding-left: 24px;
}

.essay-body li + li {
  margin-top: 10px;
}

.essay-figure {
  margin: 36px 0;
}

.essay-figure-wide {
  width: min(var(--wide), calc(100vw - 56px));
  margin-left: 50%;
  transform: translateX(-50%);
}

.essay-figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  width: min(var(--wide), calc(100vw - 56px));
  margin: 36px 0 36px 50%;
  transform: translateX(-50%);
}

.essay-figure-grid .essay-figure {
  margin: 0;
}

.essay-figure-hero {
  width: 100%;
  margin: -18px 0 48px;
}

.essay-figure img {
  width: 100%;
  border: 1px solid rgba(23, 21, 18, 0.08);
  background: #fff;
}

.essay-figure figcaption {
  margin-top: 10px;
  color: var(--faint);
  font-size: 15px;
  line-height: 1.55;
}

.footer {
  margin-top: 96px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 15px;
}

.footer p {
  margin: 0;
}

.footer p + p {
  margin-top: 6px;
}

.contact-copy,
.bookshelf-copy,
.projects-copy {
  color: var(--muted);
}

.projects-page .page {
  max-width: 1280px;
}

.research-post-page .page {
  max-width: 1280px;
}

.projects-main {
  width: min(1120px, 100%);
  overflow: visible;
}

.research-post-main {
  width: min(1120px, 100%);
  overflow: visible;
}

.research-post-page .essay-body {
  font-size: 18px;
  line-height: 1.82;
}

.research-post-page .essay-body h2 {
  font-size: 27px;
}

.research-post-page .essay-figure-wide {
  width: 100%;
}

.projects-top {
  display: block;
  margin: 28px 0 40px;
  overflow: visible;
}

.projects-toc {
  margin: 0;
}

.projects-toc-label {
  margin-bottom: 10px;
  color: var(--faint);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.projects-toc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.projects-toc-list a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid rgba(23, 21, 18, 0.12);
}

.projects-toc-list a:hover,
.projects-toc-list a:focus-visible {
  color: var(--text);
  border-bottom-color: rgba(23, 21, 18, 0.3);
}

.projects-list li + li {
  margin-top: 28px;
}

.project-title {
  font-size: 30px;
  font-weight: 400;
  line-height: 1.1;
}

.project-blurb {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 720px;
}

.project-meta {
  margin-top: 6px;
  color: var(--faint);
  font-size: 16px;
}

.project-entries {
  margin-top: 40px;
}

.project-entry + .project-entry {
  margin-top: 72px;
}

.project-entry-featured {
  position: relative;
  margin: 0 0 8px;
  padding: 28px 30px 32px;
  border-left: 4px solid var(--link);
  border-top: 1px solid rgba(49, 90, 154, 0.24);
  border-bottom: 1px solid rgba(49, 90, 154, 0.24);
  background: rgba(49, 90, 154, 0.045);
}

.project-entry-featured.project-entry-featured-plain {
  border-left: none;
  border-top: none;
  border-bottom: none;
  background: none;
  padding-left: 0;
}

.project-entry-split {
  display: block;
}

.project-entry-top {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
  gap: 34px;
  align-items: start;
}

.project-entry-top-no-media {
  display: block;
}

.project-entry-title {
  margin: 0 0 6px;
  font-size: 25px;
  font-weight: 400;
  line-height: 1.15;
}

.project-entry-featured .project-entry-title {
  font-size: 31px;
}

.project-entry-kicker {
  margin-bottom: 8px;
  color: var(--link);
  font-size: 15px;
  line-height: 1.4;
}

.project-entry-featured .project-entry-kicker {
  display: inline-block;
  margin-bottom: 12px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(49, 90, 154, 0.32);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-entry-meta {
  margin-bottom: 16px;
  color: var(--faint);
  font-size: 16px;
}

.project-entry-body {
  min-width: 0;
}

.project-entry-media {
  min-width: 0;
  padding-top: 4px;
}

.project-entry-toggle {
  display: inline-block;
  margin-top: 10px;
  padding: 0;
  background: none;
  border: none;
  color: var(--link);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: 0.01em;
}

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

.project-entry-toggle-arrow {
  display: inline-block;
  transition: transform 180ms ease;
  font-style: normal;
}

.project-entry.is-expanded .project-entry-toggle-arrow {
  transform: rotate(90deg);
}

.project-entry-details {
  display: none;
  margin-top: 20px;
}

.project-entry.is-expanded .project-entry-details {
  display: block;
}

.project-slideshow {
  position: relative;
}

.project-slide-viewport {
  position: relative;
  aspect-ratio: var(--project-slide-ratio, 1.6 / 1);
  overflow: hidden;
  background: transparent;
  border: 1px solid rgba(23, 21, 18, 0.08);
}

.project-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.project-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.project-slide-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  height: 30px;
  width: 30px;
  border: none;
  background: rgba(255, 253, 249, 0.9);
  color: var(--faint);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 140ms ease;
  padding: 0;
}

.project-slide-prev {
  left: 10px;
}

.project-slide-next {
  right: 10px;
}

.project-slide-button:hover,
.project-slide-button:focus-visible {
  color: var(--text);
}

.project-slide-dots {
  display: flex;
  gap: 7px;
  justify-content: flex-start;
  margin-top: 12px;
}

.project-slide-dot {
  width: 6px;
  height: 6px;
  border: none;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background-color 140ms ease;
  padding: 0;
}

.project-slide-dot.is-active,
.project-slide-dot:hover,
.project-slide-dot:focus-visible {
  background: var(--text);
}

.project-entry-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.project-entry-copy,
.project-entry-impact {
  margin: 14px 0 0;
  color: var(--muted);
}

.project-entry-link {
  margin: 14px 0 0;
}

.project-entry-featured .project-entry-link {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.project-entry-featured .project-entry-link-primary {
  margin: 14px 0 18px;
}

.project-entry-featured .project-entry-link a {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  min-height: 34px;
  padding: 4px 14px;
  border: 1px solid rgba(49, 90, 154, 0.34);
  color: var(--link);
  text-decoration: none;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.94), rgba(230, 238, 255, 0.9) 48%, rgba(255, 255, 255, 0.96)),
    rgba(255, 253, 249, 0.72);
  box-shadow: 0 8px 20px rgba(49, 90, 154, 0.08);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.project-entry-featured .project-entry-link a::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -55%;
  width: 42%;
  transform: skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.78), transparent);
  transition: left 260ms ease;
}

.project-entry-featured .project-entry-link a:hover,
.project-entry-featured .project-entry-link a:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(49, 90, 154, 0.62);
  box-shadow: 0 12px 26px rgba(49, 90, 154, 0.13);
  color: var(--text);
}

.project-entry-featured .project-entry-link a:hover::after,
.project-entry-featured .project-entry-link a:focus-visible::after {
  left: 115%;
}

.project-entry-list {
  margin: 18px 0 0;
  padding-left: 22px;
  color: var(--muted);
}

.project-entry-list li + li {
  margin-top: 8px;
}

.contact-links li + li,
.meta-list li + li {
  margin-top: 8px;
}

.home-page .meta-list li + li {
  margin-top: 0;
}

.home-note {
  color: var(--muted);
}

@media (max-width: 700px) {
  body {
    font-size: 18px;
  }

  .page {
    padding: 22px 18px 64px;
  }

  .projects-main {
    width: 100%;
  }

  .projects-top {
    margin: 24px 0 34px;
  }

  .projects-toc {
    margin: 0;
  }

  .projects-toc-list {
    display: block;
  }

  .projects-toc-list li + li {
    margin-top: 8px;
  }

  .project-entry-split {
    display: block;
  }

  .project-entry-top {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .project-slideshow {
    position: relative;
  }

  .project-entry-media {
    padding-top: 0;
  }

  .project-slide-dots {
    padding-left: 0;
  }

  .project-slide-button {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .home-layout {
    display: block;
    flex: 0 0 auto;
  }

  .home-tree-left-stage {
    display: none;
  }

  .home-tree-stage {
    min-height: 0;
    margin-top: 36px;
  }

  .home-page {
    overflow: auto;
  }

  .home-page .page {
    min-height: auto;
  }

  .home-page .meta-list {
    margin-left: 0;
    flex-wrap: wrap;
    gap: 12px;
  }

  .home-trees-desktop {
    display: none;
  }

  .home-tree-mobile {
    display: block;
  }

  .tree-mobile-canvas {
    width: 100%;
    height: 360px;
    display: block;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 56px;
  }

  .site-nav {
    gap: 14px;
  }

  .intro h1,
  .page-title {
    font-size: 34px;
  }

  .intro p,
  .lede,
  .essay-body {
    font-size: 18px;
  }

  .index-title,
  .book-title,
  .project-title {
    font-size: 23px;
  }

  .essay-body h2 {
    font-size: 28px;
  }

  .essay-figure-grid {
    grid-template-columns: 1fr;
  }
}
