:root {
  --bg: #f6f1e8;
  --paper: #fffdf8;
  --ink: #1c1917;
  --muted: #78716c;
  --line: #e7e0d4;
  --accent: #1d4ed8;
  --live: #a8a29e;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.wrap-wide {
  max-width: 74rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  align-items: center;
  margin: 0 0 1.75rem;
  font-family: var(--sans);
  font-size: 0.9rem;
}

.site-nav a {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.site-nav a:hover {
  border-color: var(--ink);
  text-decoration: none;
}

.site-nav a.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.intro {
  width: 100%;
  margin: 0 0 1.75rem;
  padding: 0 0 1.2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.5;
}

.intro-banner {
  height: 7.5rem;
  overflow: hidden;
}

.intro-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.intro-avatar {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  margin: -2.5rem 0 0 1.15rem;
  border: 3px solid var(--paper);
  border-radius: 50%;
  object-fit: cover;
  background: var(--paper);
}

.intro-copy {
  padding: 0.75rem 1.25rem 0;
}

.intro p {
  margin: 0 0 0.7rem;
}

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

.lede {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
}

.tweet-body {
  max-width: 42rem;
  margin: 0 auto;
}

.thread-years {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  font-family: var(--sans);
}

.thread-years button {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0.25rem 0.55rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.thread-years button.active {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--ink);
}

.picker {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 2rem;
}

.picker button {
  appearance: none;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0.45rem 0.6rem;
  cursor: pointer;
  font: inherit;
}

.picker button.active {
  border-left-color: var(--ink);
  background: var(--paper);
}

.picker button:disabled {
  color: var(--live);
  cursor: default;
}

.picker .meta {
  display: block;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.sort-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-family: var(--sans);
  font-size: 0.8rem;
}

.sort-row button {
  appearance: none;
  border: 0;
  background: none;
  color: var(--muted);
  padding: 0;
  font: inherit;
  cursor: pointer;
}

.sort-row button.active {
  color: var(--ink);
}

.post,
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem 1.15rem;
  margin-bottom: 1rem;
}

.post-meta,
.card-meta {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.post-text,
.card-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.post img,
.card img,
.post video,
.card video {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0.5rem 0 0;
}

.status {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.9rem;
}

.tweet-nav {
  margin: 0 0 1.25rem;
  font-family: var(--sans);
}

.year-row,
.month-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.15rem 0.85rem;
}

.year-row {
  margin-bottom: 0.45rem;
}

.year-row button,
.month-row button {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: var(--muted);
}

.year-row button {
  font-size: 0.85rem;
}

.month-row button {
  font-size: 0.92rem;
}

.year-row button.active,
.month-row button.active {
  color: var(--ink);
  font-weight: 600;
}

.month-row button:disabled {
  color: var(--live);
  cursor: default;
}

.month-row .n {
  margin-left: 0.2rem;
  font-size: 0.72em;
  font-weight: 400;
  color: var(--muted);
}

.month-row button.active .n {
  color: var(--ink);
}

.thread-shell {
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) minmax(0, 42rem);
  gap: 2.25rem;
  align-items: start;
}

.thread-pane {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding-right: 0.25rem;
}

.thread-years {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
  padding-bottom: 0.5rem;
}

.picker {
  margin-bottom: 0;
}

.picker button {
  font-family: var(--sans);
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--ink);
}

.thread-reader {
  position: relative;
  min-width: 0;
  padding-left: 1.15rem;
}

.thread-reader:has(.post)::before {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 1.2rem;
  bottom: 1.2rem;
  width: 2px;
  background: var(--line);
}

.thread-reader .post {
  position: relative;
  margin-bottom: 0.85rem;
}

.thread-reader .post:last-child {
  margin-bottom: 0;
}

.thread-reader .post::before {
  content: "";
  position: absolute;
  left: -1.07rem;
  top: 1.15rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
  z-index: 1;
}

@media (max-width: 840px) {
  .thread-shell {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .thread-pane {
    position: static;
    max-height: 18rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.75rem;
  }
}
