:root {
  color-scheme: light;
  --bg: #fff9e0;
  --bg-raise: rgba(255, 252, 236, 0.82);
  --wash: #f7ed92;
  --accent: #fae17a;
  --ink: #1b1914;
  --muted: #4a4538;
  --faint: #5e584a;
  --line: rgba(48, 40, 12, 0.16);
  --link: #1a4a42;
  --kicker: #6a4b12;
  --shadow: 0 18px 40px rgba(70, 58, 10, 0.06);
  --serif: "Fraunces", "Iowan Old Style", Palatino, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1f1f28;
  --bg-raise: #2a2a37;
  --wash: #363646;
  --accent: #e6c384;
  --ink: #f2d08a;
  --muted: #d4bc80;
  --faint: #957fb8;
  --line: #363646;
  --link: #7fb4ca;
  --kicker: #e6c384;
  --shadow: none;
}

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

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 100% -10%, var(--wash), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 420;
  line-height: 1.55;
  letter-spacing: 0.005em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 auto 0 0;
  width: 10px;
  background: var(--accent);
  pointer-events: none;
}

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

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

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

::selection {
  background: var(--accent);
  color: #1b1914;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--accent);
  color: #1b1914;
  padding: 0.5rem 0.8rem;
  z-index: 5;
}

.skip:focus {
  top: 0.75rem;
}

.wrap {
  width: min(1080px, calc(100% - 3rem));
  margin: 0 auto;
  padding-bottom: 4.5rem;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.15rem 0 0.4rem;
  position: sticky;
  top: 0;
  z-index: 3;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
}

.brand {
  font-family: var(--serif);
  font-weight: 560;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  gap: 1.15rem;
  margin-left: auto;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.theme-toggle {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: #1b1914;
  font: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.42rem 0.8rem;
  cursor: pointer;
}

.opening {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr;
  gap: 2.5rem 3rem;
  align-items: end;
  padding: 3.2rem 0 2.4rem;
}

.opening.with-visit {
  align-items: start;
}

.opening-aside {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  min-width: 0;
}

.visit {
  margin: 0;
  min-width: 0;
}

.visit img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: var(--wash);
  border: 1px solid var(--line);
}

.visit figcaption {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.eyebrow,
.kicker {
  margin: 0 0 0.7rem;
  color: var(--kicker);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

h1 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(2.15rem, 4.4vw, 3.6rem);
  font-variation-settings: "opsz" 144, "SOFT" 40, "WONK" 1;
}

h1.mast {
  max-width: none;
  font-size: clamp(3.4rem, 8vw, 6.4rem);
}

h2 {
  margin: 0 0 1.2rem;
  font-size: clamp(2rem, 4vw, 2.8rem);
}

h3 {
  margin: 0 0 0.35rem;
  font-size: 1.55rem;
}

.lede {
  margin: 1rem 0 0;
  max-width: 38rem;
  font-size: 1.28rem;
  line-height: 1.4;
}

.opening p:last-child {
  margin-bottom: 0;
}

.facts {
  margin: 0;
  padding: 1.1rem 1.15rem;
  list-style: none;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  container-type: inline-size;
}

.facts li {
  display: grid;
  grid-template-columns: 9.2rem 1fr;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
}

.facts li:first-child {
  border-top: 0;
}

.facts span {
  color: var(--faint);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@container (max-width: 20rem) {
  .facts li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

.section {
  padding: 2.2rem 0 0.4rem;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0.3rem 0 0;
  border-top: 1px solid var(--line);
}

.timeline li {
  display: grid;
  grid-template-columns: 11.5rem 1fr;
  gap: 1.5rem;
  padding: 1.35rem 0 1.35rem 1.2rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.7rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}

.when {
  color: var(--muted);
  font-size: 0.92rem;
}

.when strong {
  display: block;
  color: var(--ink);
  font-weight: 560;
}

.now {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  background: var(--accent);
  color: #1b1914;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 0.1em;
}

.timeline p,
.project p,
.prose p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.interest-grid,
.project-list {
  display: grid;
  gap: 1rem;
}

.interest-grid {
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2.4rem;
}

.panel,
.project {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  padding: 1.25rem 1.3rem 1.35rem;
}

.panel p,
.project p {
  color: var(--muted);
}

.index {
  display: block;
  margin-bottom: 0.7rem;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--kicker);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.meta li {
  border: 1px solid var(--line);
  padding: 0.15rem 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.repo {
  display: inline-block;
  margin-top: 0.95rem;
  color: var(--ink);
  font-weight: 560;
}

.pair {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.pair a {
  color: var(--ink);
}

.note {
  margin-top: 0.8rem;
  font-size: 0.92rem;
}

.coursework {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}

.coursework ul {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
}

.coursework li + li {
  margin-top: 0.35rem;
}

.shelf {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.shelf li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.shelf strong {
  font-weight: 560;
}

.writers {
  margin: 0.4rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.writers a {
  color: inherit;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.2rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.88rem;
}

.site-footer a {
  color: var(--faint);
}

.quote-open {
  grid-template-columns: 1fr;
  padding-bottom: 0.4rem;
}

.epigraph {
  margin: 1.4rem 0 0;
  padding: 0;
  border: 0;
  max-width: 28rem;
}

.epigraph p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.epigraph footer {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.quote-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  margin-top: 1.6rem;
}

.quote-nav a {
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  font-size: 0.92rem;
}

.quote-section {
  scroll-margin-top: 4.5rem;
}

.quote-section h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.quotes {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.quotes li {
  padding: 1.15rem 0 1.2rem;
  border-bottom: 1px solid var(--line);
}

.quotes .line {
  margin: 0;
  max-width: 40rem;
  font-family: var(--serif);
  font-size: 1.28rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.quotes .who {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.colophon {
  margin-top: 1.4rem;
  max-width: 42rem;
  color: var(--faint);
  font-size: 0.88rem;
}

.read-section {
  scroll-margin-top: 4.5rem;
  margin-top: 2.8rem;
}

.read-section h2 {
  margin-bottom: 0.7rem;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

.read-section .why {
  max-width: 42rem;
  margin: 0;
  color: var(--muted);
}

.read-section .count {
  margin: 0.85rem 0 0;
  color: var(--kicker);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.papers {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.papers li {
  display: grid;
  grid-template-columns: minmax(11rem, 17rem) minmax(0, 1fr) 3.2rem;
  gap: 0.35rem 1.2rem;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.papers .who {
  color: var(--muted);
  font-size: 0.92rem;
}

.papers a {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.papers .year {
  color: var(--faint);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.shelf-block {
  margin-top: 2.4rem;
}

.shelf-block h2 {
  margin-bottom: 0.9rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

.shelf-label {
  margin: 1.8rem 0 0.75rem;
  color: var(--kicker);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 560;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.book-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: 0.9rem;
}

.book-item {
  display: flex;
  gap: 1rem;
  min-height: 9.2rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--bg-raise);
  color: inherit;
  text-decoration: none;
}

a.book-item:hover {
  border-color: var(--accent);
}

a.book-item:hover .book-title {
  text-decoration: underline;
}

.book-cover {
  flex: 0 0 5rem;
  width: 5rem;
  height: 7.5rem;
  background: var(--wash);
  overflow: hidden;
}

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

.book-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.book-title {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.book-author {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.book-year {
  margin-top: auto;
  padding-top: 0.45rem;
  color: var(--faint);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

@media (max-width: 800px) {
  body::before {
    width: 6px;
  }

  .wrap {
    width: min(1080px, calc(100% - 1.6rem));
  }

  .site-header {
    flex-wrap: wrap;
  }

  .site-nav {
    gap: 0.75rem;
  }

  .opening,
  .interest-grid,
  .timeline li,
  .shelf li,
  .facts li {
    grid-template-columns: 1fr;
  }

  .facts li {
    gap: 0.15rem;
  }

  .papers li {
    grid-template-columns: 1fr auto;
  }

  .papers .who {
    grid-column: 1 / -1;
  }

  h1 {
    font-size: clamp(1.85rem, 8vw, 2.6rem);
  }

  h1.mast {
    font-size: clamp(3rem, 16vw, 4.4rem);
  }

  .site-footer {
    flex-direction: column;
  }
}

.life-photos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.life-photos li {
  min-width: 0;
}

.life-photos figure {
  margin: 0;
  min-width: 0;
}

.life-photos img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: var(--wash);
  border: 1px solid var(--line);
}

.life-photos figcaption {
  margin-top: 0.65rem;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (min-width: 720px) {
  .life-photos {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.6rem 1.05rem;
  }

  .life-photos li {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
  }

  .life-photos figure {
    width: max-content;
    max-width: 100%;
  }

  .life-photos img {
    width: auto;
    height: 15.5rem;
  }

  .life-photos figcaption {
    width: 0;
    min-width: 100%;
  }
}

@media (min-width: 980px) {
  .life-photos img {
    height: 17.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
