:root {
  --paper: #efefef;
  --ink: #15120f;
  --muted: #6d6258;
  --accent: #1a5fb4;
  --card: #fdfdfc;
  --shadow: rgba(20, 16, 12, 0.08);
  --card-border: rgba(21, 18, 15, 0.08);
  --rule: rgba(21, 18, 15, 0.08);
  --tag-border: rgba(21, 18, 15, 0.25);
  --tag-bg-blue: rgba(62, 126, 207, 0.08);
  --tag-bg-red: rgba(217, 72, 72, 0.08);
  --tag-bg-neutral: rgba(21, 18, 15, 0.08);
  --pdf-border: rgba(21, 18, 15, 0.35);
  --name-highlight: rgba(248, 236, 156, 0.35);
}

body[data-theme="dark"] {
  --paper: #23272b;
  --ink: #efe9e2;
  --muted: #c9bdb2;
  --accent: #8bbefb;
  --card: #2c3137;
  --shadow: rgba(0, 0, 0, 0.22);
  --card-border: rgba(239, 233, 226, 0.14);
  --rule: rgba(239, 233, 226, 0.14);
  --tag-border: rgba(239, 233, 226, 0.32);
  --tag-bg-blue: rgba(139, 190, 251, 0.16);
  --tag-bg-red: rgba(236, 110, 110, 0.18);
  --tag-bg-neutral: rgba(239, 233, 226, 0.14);
  --pdf-border: rgba(239, 233, 226, 0.4);
  --name-highlight: rgba(255, 226, 120, 0.24);
}

body[data-theme="light"] {
  --paper: #efefef;
  --ink: #15120f;
  --muted: #6d6258;
  --accent: #1a5fb4;
  --card: #fdfdfc;
  --shadow: rgba(20, 16, 12, 0.08);
  --card-border: rgba(21, 18, 15, 0.08);
  --rule: rgba(21, 18, 15, 0.08);
  --tag-border: rgba(21, 18, 15, 0.25);
  --tag-bg-blue: rgba(62, 126, 207, 0.08);
  --tag-bg-red: rgba(217, 72, 72, 0.08);
  --tag-bg-neutral: rgba(21, 18, 15, 0.08);
  --pdf-border: rgba(21, 18, 15, 0.35);
  --name-highlight: rgba(248, 236, 156, 0.35);
}

@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) {
    --paper: #23272b;
    --ink: #efe9e2;
    --muted: #c9bdb2;
    --accent: #8bbefb;
    --card: #2c3137;
    --shadow: rgba(0, 0, 0, 0.22);
    --card-border: rgba(239, 233, 226, 0.14);
    --rule: rgba(239, 233, 226, 0.14);
    --tag-border: rgba(239, 233, 226, 0.32);
    --tag-bg-blue: rgba(139, 190, 251, 0.16);
    --tag-bg-red: rgba(236, 110, 110, 0.18);
    --tag-bg-neutral: rgba(239, 233, 226, 0.14);
    --pdf-border: rgba(239, 233, 226, 0.4);
    --name-highlight: rgba(255, 226, 120, 0.24);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  font-weight: 400;
  color: var(--ink);
  background-color: var(--paper);
  min-height: 100vh;
}

.hover-preview {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  width: 220px;
  max-width: 40vw;
  pointer-events: none;
  opacity: 0;
  transform: translate(-9999px, -9999px);
  transition: opacity 0.15s ease;
}

.hover-preview.is-visible {
  opacity: 1;
}

.hover-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  box-shadow: 0 12px 28px var(--shadow);
  background: var(--card);
}

@media (hover: none), (pointer: coarse) {
  .hover-preview {
    display: none;
  }
}

@media (max-width: 900px) {
  .hover-preview {
    width: 220px;
    max-width: 70vw;
  }
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 28px 80px;
}

h1,
.card__header h2 {
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 22px;
  font-weight: 300;
  margin: 0 0 20px;
}

.name-highlight {
  display: inline;
  background: linear-gradient(transparent 5%, var(--name-highlight) 5%, var(--name-highlight) 95%, transparent 95%);
  padding: 0 1px;
}

.bio {
  font-size: 18px;
  line-height: 1.38;
  max-width: 720px;
}

.bio p {
  margin: 0 0 6px;
}

.bio__lead {
  font-weight: 600;
}

.bio__contact {
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  margin-top: 24px;
}

.bio p + .bio__contact {
  margin-top: 24px;
}


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

.bio a:hover {
  color: var(--accent);
}

.bio__contact a {
  color: var(--ink);
  text-decoration: underline;
}

.bio__contact a:hover {
  color: var(--accent);
}

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

.sections {
  margin: 40px auto 0;
  column-gap: 20px;
  column-count: 1;
  max-width: 940px;
}

.card {
  padding: 16px 22px 26px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: 0 8px 18px var(--shadow);
  display: inline-block;
  position: relative;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  width: 100%;
  max-width: 480px;
  margin: 0 0 20px;
  vertical-align: top;
}

.card__header p {
  margin: 0;
  color: var(--muted);
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.link-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}

.link-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  text-align: left;
}

.link-note {
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.7;
}

.link-title {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  font: inherit;
}

.recent-tag {
  margin-left: 8px;
  position: relative;
  top: 0;
}

.recent-tag.link-icon--outline {
  background: rgba(120, 190, 140, 0.18);
  border-color: var(--tag-border);
}

.link-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.link-list a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 400;
  transition: color 0.2s ease;
}


.link-list a:hover {
  color: var(--accent);
}

.meta {
  color: var(--muted);
  font-size: 12px;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  justify-self: end;
  opacity: 0.7;
}

.meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.year {
  min-width: 3ch;
  text-align: right;
}

.link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 0.08em;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  color: var(--muted);
}

.link-icon--outline {
  padding: 0px 3px;
  border-radius: 6px;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg-blue);
}

.pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 0.08em;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  color: var(--muted);
}

.pdf--badge {
  padding: 1px 4px;
  border-radius: 6px;
  background: rgba(21, 18, 15, 0.08);
}

.pdf--outline {
  padding: 0px 3px;
  border-radius: 6px;
  border: 1px solid var(--tag-border);
  background: var(--tag-bg-red);
}

.pdf--tag {
  padding: 0px 3px;
  border-radius: 2px;
  background: var(--tag-bg-neutral);
}

.pdf--icon {
  width: 14px;
  height: 16px;
  border-radius: 2px;
  border: 1px solid var(--pdf-border);
  position: relative;
  box-sizing: border-box;
}

.pdf--icon::after {
  content: "";
  position: absolute;
  top: 1px;
  right: 1px;
  width: 5px;
  height: 5px;
  border-top: 1px solid var(--pdf-border);
  border-right: 1px solid var(--pdf-border);
  background: var(--card);
  transform: rotate(45deg);
}

body[data-theme="dark"] {
  --paper: #202427;
  --ink: #f7f2ec;
  --muted: #d2c7bc;
  --accent: #7aa8ff;
  --card: #262b2e;
  --shadow: rgba(0, 0, 0, 0.28);
  --card-border: rgba(255, 255, 255, 0.08);
  --rule: rgba(255, 255, 255, 0.08);
  --tag-border: rgba(255, 255, 255, 0.25);
  --tag-bg-blue: rgba(122, 168, 255, 0.18);
  --tag-bg-red: rgba(255, 132, 132, 0.18);
  --tag-bg-neutral: rgba(255, 255, 255, 0.08);
  --pdf-border: rgba(255, 255, 255, 0.4);
  --name-highlight: rgba(230, 210, 128, 0.28);
}

@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]):not([data-theme="dark"]) {
    --paper: #202427;
    --ink: #f7f2ec;
    --muted: #d2c7bc;
    --accent: #7aa8ff;
    --card: #262b2e;
    --shadow: rgba(0, 0, 0, 0.28);
    --card-border: rgba(255, 255, 255, 0.08);
    --rule: rgba(255, 255, 255, 0.08);
    --tag-border: rgba(255, 255, 255, 0.25);
    --tag-bg-blue: rgba(122, 168, 255, 0.18);
    --tag-bg-red: rgba(255, 132, 132, 0.18);
    --tag-bg-neutral: rgba(255, 255, 255, 0.08);
    --pdf-border: rgba(255, 255, 255, 0.4);
    --name-highlight: rgba(230, 210, 128, 0.28);
  }
}

.fn {
  font-size: 11px;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  color: var(--muted);
  margin-left: 1px;
  vertical-align: super;
  position: relative;
  top: -0.35em;
}

.footnotes {
  margin: 22px 0 0;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.7;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}

.footnotes p {
  margin: 0;
}

@media (min-width: 900px) {
  .sections {
    column-count: 2;
  }
}

@media (max-width: 899px) {
  .page {
    padding: 20px 18px 56px;
  }

  .sections {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #bio { order: 1; }
  #books { order: 2; }
  #magazine-covers { order: 3; }
  #nyt-crosswords { order: 4; }
  #other-features { order: 5; }
}

@media (max-width: 720px) {
  .page {
    padding: 10px 16px 48px;
  }

  .hero,
  .card {
    padding: 22px;
  }
}
