@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url(/static/fonts/figtree-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url(/static/fonts/figtree-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-display: swap;
  font-weight: 300 900;
  src: url(/static/fonts/figtree-latin-wght-italic.woff2) format("woff2-variations");
}

:root {
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --bg: #ffffff;
  --fg: #16171a;
  --muted: #6c6f78;
  --faint: #9a9ca3;
  --line: #e9e9ec;
  --soft: #f4f4f6;
  --pill-bg: #16171a;
  --pill-fg: #ffffff;
  --nav-bg: rgb(255 255 255 / 0.72);
  --link: #2563eb;
  --radius: 14px;
  --gutter: 44px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1012;
    --fg: #ededef;
    --muted: #9497a0;
    --faint: #6b6e76;
    --line: #26282d;
    --soft: #191a1e;
    --pill-bg: #ededef;
    --pill-fg: #0f1012;
    --nav-bg: rgb(15 16 18 / 0.72);
    --link: #7aa7ff;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}

a {
  color: inherit;
}

img,
video {
  display: block;
  max-width: 100%;
}

.muted {
  color: var(--muted);
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 96px;
}

/* ---------- segmented control ---------- */

.tabs {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 12px 16px 0;
  pointer-events: none;
}

.tabs-inner {
  pointer-events: auto;
  display: flex;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  box-shadow:
    0 0 0 1px var(--line),
    0 8px 24px -12px rgb(0 0 0 / 0.18);
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  color: var(--muted);
  transition: color 0.15s;
}

.tab:hover {
  color: var(--fg);
}

.tab-label {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: inherit;
  view-transition-class: tab-label;
}

.tab.active {
  color: var(--pill-fg);
}

.tab-pill {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--pill-bg);
  view-transition-name: tab-pill;
}

/* Cross-document view transitions: the pill slides between tabs. */
@view-transition {
  navigation: auto;
}

/* Stacking during the transition: page, then the pill, then the labels, so
   the pill slides *behind* the tab it's moving to and the label crossfades
   from grey to white on top of it, instead of snapping at the end. */
::view-transition-group(tab-pill) {
  z-index: 1;
  animation-duration: 0.3s;
  animation-timing-function: cubic-bezier(0.3, 0.7, 0.2, 1);
}

::view-transition-group(*.tab-label) {
  z-index: 2;
  animation-duration: 0.3s;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.18s;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

/* ---------- posts ---------- */

.feed {
  padding-top: 24px;
}

.feed-item {
  padding: 20px 0;
}

.feed-item + .feed-item {
  border-top: 1px solid var(--line);
}

.post {
  display: grid;
  grid-template-columns: var(--gutter) minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  scroll-margin-top: 96px;
}

.post[data-href] {
  cursor: pointer;
}

.gutter {
  position: relative;
}

.avatar {
  width: var(--gutter);
  height: var(--gutter);
  border-radius: 50%;
  background: var(--soft);
  object-fit: cover;
}

/* thread line between consecutive posts */
.post.has-next .gutter::after,
.post.has-prev .gutter::before {
  content: "";
  position: absolute;
  left: calc(var(--gutter) / 2 - 1px);
  width: 2px;
  background: var(--line);
  border-radius: 2px;
}
.post.has-next .gutter::after {
  top: calc(var(--gutter) + 6px);
  bottom: -8px;
}
.post.has-prev .gutter::before {
  top: -8px;
  height: 4px;
}

.meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  line-height: 1.3;
  margin-top: 1px;
}

.name {
  font-weight: 700;
}

.date {
  text-decoration: none;
  white-space: nowrap;
}

.date:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}


.text {
  margin-top: 3px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

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

.text a:hover {
  text-decoration: underline;
}

/* interaction counts: deliberately quiet */
.counts {
  display: inline-flex;
  gap: 14px;
  margin-top: 8px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  text-decoration: none;
  transition: color 0.15s;
}
.counts span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.counts svg {
  width: 13px;
  height: 13px;
}
.counts:hover {
  color: var(--muted);
}

/* ---------- media ---------- */

.media,
.ext,
.quote {
  margin-top: 10px;
  border-radius: var(--radius);
  overflow: hidden;
}

.media.single {
  display: block;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
}

.media.single img {
  max-height: min(520px, 70vh);
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: cover;
  background: var(--soft);
}

.media.single.sized img {
  width: 100%;
  height: 100%;
  max-height: none;
}

.media.grid {
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr 1fr;
}
.media.grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--soft);
}
.media.grid a {
  display: block;
  min-height: 0;
  overflow: hidden;
}
.media.grid.n2 {
  aspect-ratio: 2 / 1;
}
.media.grid.n3 {
  aspect-ratio: 3 / 2;
  grid-template-rows: 1fr 1fr;
}
.media.grid.n3 a:first-child {
  grid-row: span 2;
}
.media.grid.n4 {
  aspect-ratio: 3 / 2;
  grid-template-rows: 1fr 1fr;
}

.media.gallery {
  display: flex;
  gap: 6px;
  height: 340px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--radius);
  overscroll-behavior-x: contain;
}
.media.gallery::-webkit-scrollbar {
  display: none;
}
.media.gallery a {
  flex: none;
  height: 100%;
  max-width: 85%;
  scroll-snap-align: start;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.media.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--soft);
}

.media.video {
  background: #000;
  border: 1px solid var(--line);
}
.media.video video {
  width: 100%;
  height: 100%;
}

.ext {
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
  transition: background 0.15s;
}
.ext:hover,
.quote:hover {
  background: var(--soft);
}
.ext-thumb {
  width: 100%;
  aspect-ratio: 1.91 / 1;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}
.ext-body {
  padding: 10px 14px 12px;
}
.ext-title {
  font-weight: 650;
  line-height: 1.3;
}
.ext-desc {
  margin-top: 2px;
  font-size: 15px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ext-host {
  margin-top: 6px;
  font-size: 13px;
  color: var(--faint);
}

.quote {
  display: block;
  cursor: pointer;
  padding: 10px 14px 12px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-size: 16px;
  transition: background 0.15s;
}
.quote .media,
.quote .ext {
  margin-top: 8px;
  border-radius: 10px;
}
.quote-head {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  font-size: 15px;
}
.quote-head .handle {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.avatar-xs {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex: none;
}
.quote-text {
  margin-top: 4px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.quote-missing,
.quote-other {
  color: var(--muted);
}

/* ---------- feed paging ---------- */

.more,
.end {
  display: block;
  text-align: center;
  padding: 32px 0;
  color: var(--muted);
  text-decoration: none;
}
.more:hover {
  color: var(--fg);
}
.more.loading {
  pointer-events: none;
  opacity: 0.5;
}

/* ---------- thread ---------- */

.thread {
  padding-top: 32px;
}

.post.anchor {
  display: block;
  padding-top: 8px;
}
.post.anchor.has-prev {
  position: relative;
}
.post.anchor.has-prev::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(var(--gutter) / 2 - 1px);
  width: 2px;
  height: 4px;
  background: var(--line);
}
.anchor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.3;
}
.anchor .text {
  margin-top: 12px;
  font-size: 20px;
  line-height: 1.45;
}
.anchor .media,
.anchor .ext,
.anchor .quote {
  margin-top: 14px;
}
.anchor-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.anchor-foot a {
  margin-left: auto;
  text-decoration: none;
}
.anchor-foot a:hover {
  text-decoration: underline;
}

.replies {
  padding-top: 8px;
}
.branch + .branch {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.nested {
  margin-left: calc(var(--gutter) + 12px);
}

/* tree of replies, like bsky.app's tree view */
.tree {
  margin-top: 4px;
}
.tree > .node {
  padding: 16px 0 4px;
}
.tree > .node + .node {
  border-top: 1px solid var(--line);
}
.node-children {
  margin-left: 11px;
  padding-left: 18px;
  border-left: 2px solid var(--line);
}
.node-children > .node {
  padding-top: 14px;
}
/* Past 5 levels, stop indenting so deep threads stay readable on phones. */
.node-children .node-children .node-children .node-children .node-children .node-children {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}
@media (max-width: 480px) {
  .node-children {
    margin-left: 7px;
    padding-left: 12px;
  }
}
.reply[data-href] {
  cursor: pointer;
}
.reply-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  line-height: 1.3;
}
.avatar-sm {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--soft);
}
.reply-head .name,
.meta a.name {
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reply-head .name:hover,
.meta a.name:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.reply-body {
  padding-left: 32px;
}
.reply-body .text {
  margin-top: 2px;
}
.more-replies {
  display: inline-block;
  margin: 8px 0 0 32px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.more-replies:hover {
  color: var(--fg);
}
.thread > .more-replies {
  margin: 12px 0;
}

/* moderation */
.tombstone {
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--muted);
  font-size: 14px;
}
.cw {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.cw > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--muted);
  list-style: none;
  cursor: pointer;
}
.cw > summary::-webkit-details-marker {
  display: none;
}
.cw-toggle::before {
  content: "Show";
  font-weight: 600;
  color: var(--fg);
}
.cw[open] .cw-toggle::before {
  content: "Hide";
}
.cw-body {
  padding: 0 12px 12px;
}

/* ---------- blog ---------- */

.blog-index {
  padding-top: 40px;
}
.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.doc-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 0;
  text-decoration: none;
}
.doc-list li + li .doc-link {
  border-top: 1px solid var(--line);
}
.doc-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.doc-link:hover .doc-title {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
.doc-date {
  font-size: 14px;
  margin-top: 4px;
}
.rss {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  font-size: 15px;
  text-decoration: none;
}

.article {
  padding-top: 32px;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
}
.back:hover {
  color: var(--fg);
}
.article-title {
  margin: 20px 0 6px;
  font-size: clamp(30px, 6vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 800;
  text-wrap: balance;
}
.article-meta {
  margin: 0;
  font-size: 15px;
}
.cover {
  margin-top: 24px;
  width: 100%;
  border-radius: var(--radius);
}

.prose {
  margin-top: 32px;
  font-size: 18px;
  line-height: 1.7;
}
.prose > :first-child {
  margin-top: 0;
}
.prose p,
.prose ul,
.prose ol {
  margin: 1.1em 0;
}
.prose li + li {
  margin-top: 0.3em;
}
.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 2em 0 0.6em;
}
.prose h2 {
  font-size: 26px;
}
.prose h3 {
  font-size: 21px;
}
.prose a {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--faint);
}
.prose a:hover {
  text-decoration-color: currentColor;
}
.prose .quote {
  text-decoration: none;
  line-height: 1.5;
  margin: 1.5em 0;
}
.prose blockquote {
  margin: 1.5em 0;
  padding-left: 18px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5em 0;
}
.prose figure {
  margin: 1.8em 0;
}
.prose figure img {
  border-radius: 10px;
  margin: 0 auto;
}
.prose figcaption {
  margin-top: 8px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}
.prose :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.15em 0.35em;
  border-radius: 6px;
  background: var(--soft);
}
.prose pre {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  padding: 16px 18px;
  border-radius: 12px;
  overflow-x: auto;
  background: var(--soft);
  border: 1px solid var(--line);
}
.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 16px;
}
.prose th,
.prose td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}

/* shiki dual themes */
.shiki,
.shiki span {
  color: var(--shiki-light);
}
.prose pre.shiki {
  background: var(--soft) !important;
}
@media (prefers-color-scheme: dark) {
  .shiki,
  .shiki span {
    color: var(--shiki-dark);
  }
}

/* ---------- repos ---------- */

.repos {
  padding-top: 40px;
}
.repo-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.repo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 0;
  text-decoration: none;
}
.repo-list li + li .repo {
  border-top: 1px solid var(--line);
}
.repo-name {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.repo:hover .repo-name {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}
.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 4px;
  font-size: 14px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.repo-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ---------- about ---------- */

.about {
  padding-top: 56px;
}
.about-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}
.about h1 {
  margin: 24px 0 8px;
  font-size: 34px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.about p {
  font-size: 19px;
  line-height: 1.6;
  margin: 12px 0;
}
.about p a {
  text-underline-offset: 3px;
  text-decoration-color: var(--faint);
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
}
.links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s;
}
.links a:hover {
  background: var(--soft);
}

.empty {
  text-align: center;
  padding-top: 80px;
}

/* ---------- lightbox ---------- */

.lightbox {
  border: 0;
  padding: 0;
  max-width: 100vw;
  max-height: 100dvh;
  width: 100vw;
  height: 100dvh;
  background: transparent;
  cursor: zoom-out;
}
.lightbox::backdrop {
  background: rgb(0 0 0 / 0.88);
}
.lightbox img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }
  :root {
    --gutter: 40px;
  }
  .tabs {
    padding-left: 16px;
    padding-right: 16px;
  }
  .tab {
    gap: 5px;
    padding: 8px 10px;
    font-size: 15px;
  }
  .tab svg {
    width: 16px;
    height: 16px;
  }
}

/* Very narrow phones: keep the icon only on the active tab. */
@media (max-width: 359px) {
  .tab:not(.active) svg {
    display: none;
  }
}
