:root {
  --teal: #00d4b8;
  --purple: #7c4dff;
  --ground: #0a0d13;
  --surface: #161b22;
  --raised: #111622;
  --edge: #30363d;
  --ink: #e6edf3;
  --muted: #8b949e;
  --radius: 8px;
  --top: 57px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: rgba(0, 212, 184, 0.3); }

img { max-width: 100%; height: auto; }

/* header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--edge);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.mark { width: 32px; height: 32px; }
.name { font-weight: 700; letter-spacing: -0.01em; }
.badge {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--teal);
  background: rgba(0, 212, 184, 0.12);
  border-radius: 999px;
  padding: 2px 10px;
}

/* frame */
.shell {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.channels {
  width: 260px;
  flex: 0 0 260px;
  padding: 24px 12px;
  border-right: 1px solid var(--edge);
  position: sticky;
  top: var(--top);
  height: calc(100vh - var(--top));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.channels ul { list-style: none; margin: 0 0 18px; padding: 0; }
.channels .group + ul li a::before { content: "#"; color: #4d5560; margin-right: 8px; }
.channels ul.here { margin-top: 22px; border-top: 1px solid var(--edge); padding-top: 14px; }
.channels li a {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.92rem;
}
.channels li a:hover { background: rgba(255, 255, 255, 0.04); color: var(--ink); text-decoration: none; }
.channels li a.chosen { background: rgba(0, 212, 184, 0.12); color: var(--teal); font-weight: 600; }
.group {
  margin: 18px 12px 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}
.content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 24px 96px;
}

/* feed */
.card { position: relative; padding: 24px 0; border-bottom: 1px solid var(--edge); }
.card:hover { background: rgba(255, 255, 255, 0.02); }
.card .cardtitle a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card .prose a, .card .meta a, .card .prose img, .card .hero { position: relative; z-index: 2; }
.card:last-of-type { border-bottom: 0; }
.cardtitle { margin: 0 0 8px; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.35; }
.cardtitle a { color: var(--ink); }
.cardtitle a:hover { color: var(--teal); text-decoration: none; }
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  margin: 12px 0 0;
}
.source { width: 15px; height: 15px; flex: none; }
.tag {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #b39ddb;
  background: rgba(124, 77, 255, 0.12);
  border-radius: 999px;
  padding: 2px 8px;
}
.chip {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(0, 212, 184, 0.12);
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 500;
}
.chip:hover { text-decoration: none; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; }
.pages { display: flex; gap: 16px; padding: 28px 0 0; }

/* article */
.crumbs { color: #59626e; font-size: 0.88rem; margin-bottom: 16px; letter-spacing: 0.01em; }
.crumbs a { color: var(--muted); }
.crumbs a:last-child { color: #c9d1d9; }
.crumbs a:hover { color: var(--ink); text-decoration: none; }
.title { margin: 0 0 16px; font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.hero { margin: 0 0 24px; }
.attachment { border: 1px solid var(--edge); border-radius: 12px; display: block; }
.emoji { height: 1.375em; width: auto; vertical-align: -0.375em; display: inline-block; }
.player { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; }
.still {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--edge);
  display: block;
}

.prose { font-size: 1.02rem; line-height: 1.75; }
.prose p { margin: 0 0 16px; }
.prose h2 { font-size: 1.4rem; font-weight: 700; margin: 28px 0 12px; letter-spacing: -0.01em; }
.prose h3 { font-size: 1.15rem; font-weight: 700; margin: 24px 0 10px; }
.prose ul, .prose ol { padding-left: 26px; }
.prose li { margin-bottom: 4px; }
.prose blockquote {
  margin: 0 0 16px;
  padding-left: 20px;
  border-left: 3px solid var(--teal);
  color: var(--muted);
  font-style: italic;
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: rgba(0, 212, 184, 0.1);
  color: var(--teal);
  padding: 1.6px 6px;
  border-radius: 4px;
}
.prose pre {
  background: #0d1117;
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 18px;
  overflow-x: auto;
}
.prose pre code { background: none; color: var(--ink); padding: 0; }
.prose a { text-decoration: underline; }
.prose img { border-radius: 12px; border: 1px solid var(--edge); margin: 16px 0; }
.prose a.token img,
.prose img.emoji {
  margin: 0;
  border: 0;
  border-radius: 0;
}
.prose table { border-collapse: collapse; width: 100%; margin-bottom: 16px; }
.prose th, .prose td { border: 1px solid var(--edge); padding: 8px 10px; text-align: left; }
.token,
.prose a.token {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
  font-weight: 700;
  padding: 1px 7px 1px 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
  vertical-align: baseline;
}
.prose a.token:hover { text-decoration: none; background: rgba(0, 212, 184, 0.16); }
.token img { width: 13px; height: 13px; display: inline-block; }
.hero { margin: 0 0 24px; }
.hero .still { border-radius: 12px; }
.card .hero { margin: 14px 0; }
.card .prose { margin-top: 12px; }
.card .attachment { margin-top: 14px; }

details.written, details.transcript, details.questions {
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--raised);
  margin: 0 0 14px;
  overflow: hidden;
}
details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-weight: 600;
  padding: 13px 18px;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "▾"; color: var(--muted); font-size: 0.8em; }
details[open] summary::after { content: "▴"; }
details.written summary { color: var(--teal); background: rgba(0, 212, 184, 0.07); }
details.written[open] summary { border-bottom: 1px solid rgba(0, 212, 184, 0.18); }
details.transcript[open] summary,
details.questions[open] summary { border-bottom: 1px solid var(--edge); }
details .prose,
details > pre {
  padding: 16px 18px 4px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}
details .prose p { margin: 0 0 12px; }
details .prose h2 { font-size: 1.06rem; color: var(--ink); margin: 18px 0 8px; }
details .prose h3 { font-size: 0.98rem; color: var(--ink); margin: 16px 0 8px; }
details .prose > h2:first-child, details .prose > h3:first-child { margin-top: 0; }
details.transcript pre { white-space: pre-wrap; word-break: break-word; background: none; border: 0; }

hr { border: 0; border-top: 1px solid var(--edge); margin: 32px 0; }

.author {
  display: flex;
  align-items: center;
  gap: 26px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: var(--raised);
  padding: 22px 26px;
}
.portrait { width: 92px; height: 92px; flex: none; border-radius: 50%; }
.author h2 { margin: 0 0 8px; font-size: 1.18rem; letter-spacing: -0.01em; }
.author p { margin: 0 0 10px; color: var(--muted); font-size: 0.94rem; line-height: 1.6; }
.author .meta { margin: 0; gap: 10px; }
.uptime, .unowned, .audited {
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 14px;
}
.uptime { color: var(--teal); background: rgba(0, 212, 184, 0.12); }
.unowned { color: #4ade80; background: rgba(74, 222, 128, 0.12); }
.audited { color: #bb86fc; background: rgba(187, 134, 252, 0.12); }

@media (max-width: 620px) {
  .author { flex-direction: column; align-items: flex-start; gap: 16px; }
}

.neighbours { margin-top: 40px; }
.neighbours h2 { font-size: 1.1rem; border-top: 1px solid var(--edge); padding-top: 24px; }
.neighbours ul { list-style: none; margin: 0; padding: 0; }
.neighbours li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--edge);
}
.neighbours li:last-child { border-bottom: 0; }
.neighbours li a { color: var(--ink); font-weight: 600; }
.neighbours li a:hover { color: var(--teal); text-decoration: none; }
.stamp { color: var(--muted); font-size: 0.78rem; white-space: nowrap; }

/* videos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.grid .card { border: 1px solid var(--edge); border-radius: 12px; background: var(--raised); padding: 0 0 14px; overflow: hidden; }
.grid .card .cardtitle { font-size: 1rem; padding: 0 14px; margin-top: 10px; }
.grid .card .meta { padding: 0 14px; }
.grid .still { border-radius: 0; border: 0; border-bottom: 1px solid var(--edge); }

/* footer */
.foot { border-top: 1px solid var(--edge); padding: 26px 20px; text-align: center; color: var(--muted); font-size: 0.8rem; }
.foot p { margin: 0; }

@media (max-width: 860px) {
  .channels { display: none; }
  .shell { display: block; }
  .content { padding: 20px 16px 48px; }
  .title { font-size: 1.6rem; }
}
