:root {
  --bg: #f6f6f5;
  --fg: #161616;
  --dim: #737373;
  --faint: #a3a3a3;
  --line: #e2e2e0;
  --hover: #ececeb;
  --ph: #e6e6e4;
  --grain: 0.05;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1a1a; --fg: #ededed; --dim: #8f8f8f; --faint: #5e5e5e;
    --line: #2c2c2c; --hover: #232323; --ph: #262626; --grain: 0.07;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1a1a; --fg: #ededed; --dim: #8f8f8f; --faint: #5e5e5e;
  --line: #2c2c2c; --hover: #232323; --ph: #262626; --grain: 0.07;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Geist", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--fg); }
:focus-visible { outline: 1.5px solid var(--fg); outline-offset: 3px; border-radius: 4px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.page { max-width: 600px; margin: 0 auto; padding: 96px 20px 120px; }

.top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 64px; }
.top .name { font-size: 15px; font-weight: 500; text-decoration: none; }
.controls { display: flex; gap: 14px; color: var(--dim); }
.controls button:hover { color: var(--fg); }

.bio p { color: var(--dim); }
.bio p:first-child { color: var(--fg); }
.bio p + p { margin-top: 14px; }
.bio a { color: var(--fg); }

section { margin-top: 72px; }
h2 { font-size: 15px; font-weight: 500; padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* Rows shared by Built and Thoughts */
.row-btn, .row-link {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 16px;
  align-items: baseline;
  text-align: left;
  padding: 12px 8px;
  margin: 0 -8px;
  width: calc(100% + 16px);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s;
}
.row-btn:hover, .row-link:hover { background: var(--hover); }
.year { color: var(--faint); font-variant-numeric: tabular-nums; }
.what { color: var(--dim); text-align: right; font-variant-numeric: tabular-nums; }
.row, .post { border-bottom: 1px solid var(--line); }
.no-year .row-btn, .no-year .row-link { grid-template-columns: 1fr auto; }
.no-year .more p { padding-left: 0; }

/* Built: rows open, and the box grows to fit */
.more {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.more > div { overflow: hidden; }
.more p {
  padding: 0 0 16px 72px;
  color: var(--dim);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.row.open .more { grid-template-rows: 1fr; }
.row.open .more p { opacity: 1; transform: none; transition-delay: 0.05s; }

.all { display: inline-block; margin-top: 14px; color: var(--dim); }

/* Life: a strip of photos that runs off the right edge */
.strip {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  margin-right: calc(50% - 50vw);
  padding-right: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.photo {
  flex: 0 0 auto;
  height: 240px;
  border-radius: 6px;
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--ph);
  text-align: left;
}
.photo.tall { aspect-ratio: 4 / 5; }
.photo.wide { aspect-ratio: 3 / 2; }
.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.4s;
}
.photo:hover img { filter: grayscale(0); }
.photo .ph {
  display: flex;
  align-items: flex-end;
  height: 100%;
  padding: 12px;
  color: var(--faint);
  font-size: 13px;
}

/* Photo viewer */
.viewer {
  border: 0;
  padding: 0;
  margin: auto;
  max-width: min(92vw, 1100px);
  max-height: 90vh;
  background: transparent;
  color: var(--fg);
  overflow: visible;
}
.viewer::backdrop { background: color-mix(in srgb, var(--bg) 92%, transparent); }
.viewer[open] { animation: pop 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes pop { from { opacity: 0; transform: scale(0.96); } }
.viewer img { display: block; max-width: 100%; max-height: 82vh; border-radius: 6px; }
.viewer p { margin-top: 10px; color: var(--dim); font-size: 13px; }

.more p a { color: var(--fg); }
.dim-note { margin-top: 12px; color: var(--dim); }

.featured { margin-top: 72px; color: var(--dim); }
.featured a { color: var(--fg); }
.contact { margin-top: 16px; color: var(--dim); }
.contact a { color: var(--fg); }
.social { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.social a { color: var(--dim); }
.social a:hover { color: var(--fg); }

/* Post page */
.post-head h1 {
  font-family: "Instrument Serif", serif;
  font-size: 44px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.post-head p { margin-top: 10px; color: var(--faint); }
.prose { margin-top: 40px; }
.prose p + p, .prose h2 + p { margin-top: 16px; }
.prose h2 { border: 0; padding: 0; margin-top: 40px; }
/* Cards made by the page, in the style of the share image */
.prose .card {
  position: relative;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6cqw;
  aspect-ratio: 1200 / 630;
  margin: 28px 0;
  padding: 0 7cqw;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  text-align: center;
}
.prose .card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: calc(var(--grain) * 3);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .prose .card::after { mix-blend-mode: overlay; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .prose .card::after { mix-blend-mode: overlay; } }
.card > div { width: 80%; text-align: left; }
.card strong {
  display: block;
  font: 400 7cqw/1.05 "Instrument Serif", serif;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.card strong.long { font-size: 5.6cqw; }
.card ul { list-style: none; margin-top: 3.6cqw; border-top: 1px solid var(--line); }
.card li {
  padding: 1.4cqw 0;
  border-bottom: 1px solid var(--line);
  font-size: max(13px, 3cqw);
  line-height: 1.4;
  color: var(--dim);
}
.prose .card + p { margin-top: 0; }
.back { display: inline-block; margin-top: 72px; color: var(--dim); }

@media (max-width: 520px) {
  .page { padding-top: 56px; }
  .row-btn, .row-link { grid-template-columns: 44px 1fr; }
  .what { grid-column: 2; text-align: left; }
  .more p { padding-left: 60px; }
  .no-year .row-btn, .no-year .row-link { grid-template-columns: 1fr; }
  .no-year .what { grid-column: 1; }
  .no-year .more p { padding-left: 0; }
  .photo { height: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  .more, .more p, .photo img { transition: none; }
  .viewer[open] { animation: none; }
}

div.row-link:hover { background: none; }


.featured-list + .contact { margin-top: 72px; }

.dim-name { color: var(--dim); }
.row-btn:hover .dim-name { color: var(--fg); }
