:root {
  --bg: #eef0e7;
  --panel: #fbfcf5;
  --panel-2: #dfe5d4;
  --paper: #fffdf5;
  --ink: #252d22;
  --muted: #596453;
  --line: #bdc5b1;
  --bar: #33402e;
  --bar-ink: #f3f4e9;
  --accent: #6b6031;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: "Avenir Next", Avenir, "Gill Sans", Optima, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% -12%, rgba(107, 96, 49, .13), transparent 34rem),
    linear-gradient(180deg, #eef0e7, #e5eadf 44%, #eef0e7);
  font-family: var(--sans);
}

a { color: inherit; text-underline-offset: 3px; }

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 54px);
  color: var(--bar-ink);
  background: var(--bar);
  border-bottom: 1px solid rgba(0,0,0,.25);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.brand {
  color: inherit;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

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

.nav .active {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.page,
.edge-grid-section {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding-inline: 22px;
}

.page {
  padding-top: 30px;
  padding-bottom: 64px;
}

.profile-layout,
.two-column-layout {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.profile-rail {
  position: sticky;
  top: 64px;
  padding: 14px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.portrait {
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #d5dbc9;
}

.profile-meta {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.5;
}

.profile-meta strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 15px;
}

.social {
  display: flex;
  gap: 9px;
  padding-top: 14px;
}

.social a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.social img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.main,
.content-column {
  min-width: 0;
}

.name,
h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(40px, 5.6vw, 68px);
  line-height: .95;
  letter-spacing: -.02em;
}

.page-title {
  font-size: clamp(34px, 4.8vw, 52px);
}

.role {
  margin: 10px 0 18px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  text-transform: uppercase;
}

.bio {
  display: grid;
  gap: 13px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.56;
}

.bio p { margin: 0; }

.bio a {
  color: var(--ink);
  text-decoration-color: color-mix(in srgb, var(--accent) 65%, transparent);
}

.actions,
.links,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions { margin-top: 18px; }

.button,
.resource-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid currentColor;
  color: var(--accent);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.section {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.section-head,
.archive-head,
.photo-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0;
  border-bottom: 0;
  margin-bottom: 14px;
}

.section-head h2,
.edge-grid-head h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1;
}

.dek,
.section-head p,
.edge-grid-head p {
  max-width: 700px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.section-head p,
.edge-grid-head p {
  max-width: 440px;
  margin: 0;
  font-size: 13px;
  line-height: 1.42;
  text-align: right;
}

.stats,
.instagram-card {
  display: grid;
  gap: 7px;
  min-width: 210px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.stats strong,
.instagram-card a {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  text-transform: none;
}

.recent-list,
.ledger,
.writing-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.recent-row,
.ledger-row,
.writing-row {
  display: grid;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.recent-row {
  grid-template-columns: 104px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 12px 0;
}

.ledger-row {
  grid-template-columns: 58px 112px minmax(0, 1fr) auto;
}

.writing-row {
  grid-template-columns: 112px minmax(0, 1fr) auto;
}

.thumb,
.recent-row .image {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}

.recent-row .image {
  aspect-ratio: 1.2 / 1;
}

.thumb.paper-thumb-list img,
.recent-row .image img {
  object-fit: cover;
  object-position: center;
}

.meta,
.ledger-year {
  margin: 0 0 6px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ledger-year {
  margin: 0;
  font-size: 12px;
  font-weight: 900;
}

.paper-title,
.writing-title,
.recent-row h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.08;
}

.recent-row h3 { font-size: 21px; }

.authors,
.summary,
.recent-row p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.recent-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
}

.writing-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(82px, 1fr));
  gap: 6px;
  min-width: 180px;
}

.button-wide {
  grid-column: 1 / -1;
}

.writing-actions.no-primary .button:first-child:not(.button-wide) {
  grid-column: 2;
}

.edge-grid-section {
  margin-top: 34px;
  padding-top: 20px;
  padding-bottom: 80px;
  border-top: 1px solid var(--line);
}

.edge-grid-head {
  margin: 0 0 16px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.project-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 8px;
}

.project {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: var(--panel);
}

.project img {
  object-fit: cover;
  object-position: center;
  transition: transform .18s ease;
}

.project:hover img { transform: scale(1.045); }

.project::after {
  content: attr(data-title);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 9px 8px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .18s ease, transform .18s ease;
  text-transform: uppercase;
}

.project:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.masonry {
  columns: 3 190px;
  column-gap: 14px;
}

.photo-tile {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 14px;
  overflow: hidden;
  break-inside: avoid;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--bar-ink);
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(37, 45, 34, .08);
}

.photo-tile img {
  height: auto;
  object-fit: contain;
  transition: transform .45s ease, filter .45s ease;
}

.photo-tile:hover img {
  transform: scale(1.025);
  filter: saturate(.94) contrast(1.04);
}

.photo-caption {
  position: absolute;
  inset: auto 8px 8px;
  display: grid;
  gap: 5px;
  padding: 8px 9px;
  background: rgba(37, 45, 34, .78);
  color: #f5f6ed;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.25;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
}

.photo-caption span:last-child {
  color: rgba(245,246,237,.72);
  text-transform: uppercase;
}

.photo-tile:hover .photo-caption {
  opacity: 1;
  transform: translateY(0);
}

.paper-detail main {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 34px 22px 76px;
}

.paper-page {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 16px 38px rgba(37, 45, 34, .12);
}

.paper-head {
  padding: clamp(26px, 4vw, 48px) clamp(26px, 4vw, 52px) 26px;
  border-bottom: 1px solid var(--line);
}

.paper-detail-title {
  max-width: 850px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 50px);
  line-height: .96;
  letter-spacing: -.025em;
}

.paper-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: clamp(26px, 4vw, 42px);
  padding: 28px clamp(26px, 4vw, 52px) clamp(28px, 4vw, 48px);
  align-items: start;
}

.main-column,
.right-column {
  min-width: 0;
}

.right-column {
  display: grid;
  gap: 16px;
}

.paper-authors {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.author,
.paper-detail .button,
.paper-detail .resource-link {
  background: rgba(223, 229, 212, .62);
}

.author {
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 7px 10px;
  border: 1px solid currentColor;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.1;
  text-decoration: none;
}

.paper-detail .section {
  margin-top: 26px;
  padding-top: 22px;
}

.right-column .section {
  margin-top: 0;
  padding-top: 16px;
}

.section-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.abstract {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.62;
}

.abstract p { margin: 0 0 1em; }
.abstract p:last-child { margin-bottom: 0; }

.body-supplement {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.28);
}

.citation {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.38);
  color: var(--muted);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.55;
}

.detail-thumb {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.detail-thumb img {
  object-fit: contain;
  background: var(--panel-2);
}

.button-stack {
  display: grid;
  gap: 7px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.resource-card {
  display: block;
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  text-decoration: none;
}

.resource-card figure {
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.resource-card figure img {
  object-fit: cover;
}

.resource-card.no-image {
  display: flex;
  min-height: 120px;
}

.resource-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 12px;
}

.resource-body h4 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.08;
}

.resource-body p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.resource-body .resource-link {
  margin-top: auto;
}

@media (max-width: 920px) {
  .profile-layout,
  .two-column-layout,
  .archive-head,
  .photo-head,
  .paper-content-grid {
    grid-template-columns: 1fr;
  }

  .profile-rail {
    position: static;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 18px;
  }

  .ledger-row,
  .writing-row {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .ledger-row .links,
  .writing-row .writing-actions {
    grid-column: 2;
    justify-content: start;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 660px) {
  .topbar,
  .section-head,
  .edge-grid-head {
    align-items: start;
    flex-direction: column;
  }

  .nav { gap: 10px; }

  .section-head p,
  .edge-grid-head p {
    text-align: left;
  }

  .profile-rail,
  .recent-row,
  .ledger-row,
  .writing-row {
    grid-template-columns: 1fr;
  }

  .ledger-row .links,
  .writing-row .writing-actions {
    grid-column: auto;
  }

  .recent-actions {
    justify-content: start;
  }

  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
