/* Plain: one sans family, hairline rows, a green tint, the branch as weight. */
:root {
  --bg: #f4f8f5;
  --raised: #fbfdfc;
  --fill: #e7f0ea;
  --ink: #13201a;
  --muted: #5c6d64;
  --line: #dce7e0;
  --accent: #2a7550;
  --leaf: #3f8f63;
  --stem: #5b4a36;
  --dry: #8a6d2c;
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1512;
    --raised: #141c18;
    --fill: #17211c;
    --ink: #e3ece7;
    --muted: #92a69b;
    --line: #213029;
    --accent: #7cc9a0;
    --leaf: #6dbb90;
    --stem: #b9a68c;
    --dry: #c9ad6a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 42rem;
  padding: 0 16px 6rem;
  background: var(--bg);
  color: var(--ink);
  font: 400 0.9375rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2 { margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; font-weight: 600; line-height: 1.25; text-wrap: balance; }

/* header */
.top { display: flex; align-items: center; gap: 0.75rem 1rem; flex-wrap: wrap; padding: 1.75rem 0 1.25rem; }
.mark { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.015em; text-decoration: none; }
.mark svg { width: 1.9rem; height: 1.9rem; display: block; }
.jump { flex: 1; min-width: 12rem; }
.jump input {
  width: 100%; font: inherit; font-size: 0.875rem; color: var(--ink);
  background: var(--fill); border: 1px solid transparent; border-radius: 8px; padding: 0.45rem 0.7rem;
}
.jump input::placeholder { color: var(--muted); }
.jump input:focus { outline: none; border-color: var(--accent); background: var(--raised); }
.links { display: flex; align-items: center; gap: 1rem; font-size: 0.875rem; }
.links a { text-decoration: none; color: var(--muted); }
.links a:hover { color: var(--ink); }
.links .act { color: var(--ink); font-weight: 500; padding: 0.35rem 0.75rem; border: 1px solid var(--line); border-radius: 8px; }
.links .act:hover { border-color: var(--accent); color: var(--accent); }

/* page heads */
.head { margin: 0.5rem 0 1rem; display: grid; gap: 0.4rem; }
.gname { font-size: 1.5rem; overflow-wrap: anywhere; }
.gname a { text-decoration: none; color: var(--muted); font-weight: 500; }
.gname a:hover { color: var(--ink); }
.gname .dot { color: var(--accent); }
.desc { margin: 0; color: var(--muted); }
.subs { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; margin: 0; font-size: 0.875rem; }
.subs a { color: var(--accent); text-decoration: none; }
.subs a:hover { text-decoration: underline; }
.subs .add { color: var(--muted); }

.sorts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 1.1rem; font-size: 0.875rem; color: var(--muted); margin: 0.75rem 0 0.75rem; }
.sorts a { text-decoration: none; }
.sorts a:hover { color: var(--ink); }
.sorts a[aria-current] { color: var(--ink); font-weight: 500; }

/* feed rows */
.items { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 1rem; padding: 0.95rem 0; border-top: 1px solid var(--line); }
.item h2 { grid-column: 1; font-size: 1rem; font-weight: 500; line-height: 1.4; }
.item h2 a { text-decoration: none; }
.item h2 a:hover { color: var(--accent); }
.item h2 a:visited { color: var(--muted); }
.domain { font-size: 0.8125rem; font-weight: 400; color: var(--muted); white-space: nowrap; }
.thumb { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.thumb img { display: block; width: 3rem; height: 3rem; object-fit: cover; border-radius: 6px; background: var(--fill); }

.m { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.9rem; font-size: 0.8125rem; color: var(--muted); }
.m a { text-decoration: none; }
.m a:hover { text-decoration: underline; }
.m .g { color: var(--accent); }
.new { color: var(--accent); font-weight: 500; text-decoration: none; }
.m .new { margin-left: -0.5rem; }
.who { color: var(--ink); font-weight: 500; }

/* weight + voting */
.vote { display: inline-flex; align-items: center; gap: 0.1rem; }
.vote form { margin: 0; }
.vote .w { display: inline-flex; margin-right: 0.15rem; }
.vote .w svg { width: 1.4rem; height: 1.4rem; display: block; }
.vote button {
  font: 500 0.875rem/1 var(--font); width: 1.5rem; height: 1.4rem; padding: 0;
  border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
.vote button:hover { background: var(--fill); color: var(--accent); }
.vote button.up.on { color: var(--accent); }
.vote button.down.on { color: var(--dry); }
.vote button.on, .vote button:focus-visible,
.item:hover .vote button, .item:focus-within .vote button,
.post:hover .vote button, .post:focus-within .vote button,
.acts .vote button { opacity: 1; pointer-events: auto; }

.pager { display: flex; justify-content: space-between; font-size: 0.875rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.pager a { color: var(--accent); text-decoration: none; }
.pager a:last-child { margin-left: auto; }
.empty { color: var(--muted); }
.empty a { color: var(--accent); }

/* thread */
.post { display: grid; gap: 0.5rem; padding-top: 0.5rem; }
.where { display: flex; flex-wrap: wrap; gap: 0 0.9rem; margin: 0; font-size: 0.8125rem; }
.where a { color: var(--accent); text-decoration: none; }
.post h1 a { text-decoration: none; }
.post .domain { font-size: 0.875rem; }
.pic { margin: 0.5rem 0 0; }
.pic img { display: block; width: auto; height: auto; max-width: min(100%, 18rem); max-height: 12rem; border-radius: 8px; background: var(--fill); cursor: zoom-in; }
.prose { max-width: 38rem; line-height: 1.6; }
.prose p { margin: 0.55rem 0 0; }
.prose p:first-child { margin-top: 0; }
.prose blockquote { margin: 0.45rem 0 0; padding: 0 0 0 0.75rem; border-left: 2px solid var(--line); color: var(--muted); }
.post .prose { margin-top: 0.5rem; font-size: 1rem; }

.digest { margin: 2rem 0 0; padding: 0.9rem 1rem; background: var(--fill); border-radius: 10px; }
.digest h2 { font-size: 0.8125rem; font-weight: 600; color: var(--accent); }
.digest ul { margin: 0.4rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.35rem; }
.digest a { text-decoration: none; }
.digest a:hover { text-decoration: underline; }

.replies { margin-top: 2rem; }
.replies > .sorts { margin: 2rem 0 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.sorts .new { margin-left: auto; font-weight: 400; }

/* forms */
label { display: block; font-size: 0.875rem; font-weight: 500; margin: 1rem 0 0.35rem; }
.hint { font-weight: 400; color: var(--muted); }
input, textarea {
  width: 100%; font: inherit; color: inherit; background: var(--raised);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.7rem;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type="file"] { padding: 0.4rem; font-size: 0.875rem; }
form button:not(.vote button) {
  margin-top: 0.6rem; font: 500 0.875rem var(--font); cursor: pointer;
  padding: 0.45rem 0.95rem; border: 0; border-radius: 8px; background: var(--accent); color: var(--bg);
}
form button:not(.vote button):hover { filter: brightness(1.08); }
.say label { margin-top: 0; }
.form { max-width: 34rem; }
.error { color: var(--dry); margin: 0 0 0.5rem; }

/* comment tree: depth is a hairline you can follow */
summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 0 0.7rem; align-items: baseline; font-size: 0.8125rem; color: var(--muted); width: fit-content; }
summary::-webkit-details-marker { display: none; }
.folded { display: none; padding: 0 0.45rem; border-radius: 999px; background: var(--fill); color: var(--accent); }
.c:not([open]) > summary .folded { display: inline; }
.c { margin-top: 0.85rem; }
.c > .prose { margin-top: 0.15rem; }
.c.is-new > .prose { position: relative; }
.c.is-new > .prose::before { content: ""; position: absolute; left: -0.7rem; top: 0.35rem; bottom: 0.35rem; width: 2px; border-radius: 2px; background: var(--accent); }

.acts { display: flex; align-items: center; gap: 0.5rem; min-height: 1.6rem; margin-top: 0.1rem; opacity: 0; transition: opacity 0.12s; }
.acts .vote .w svg { width: 1.2rem; height: 1.2rem; }
.c:has(> summary:hover, > .prose:hover, > .acts:hover, > .acts:focus-within) > .acts,
.acts:has(.voted, details[open]) { opacity: 1; }
.reply { flex: 1; }
.reply > summary { font-weight: 500; padding: 0.1rem 0.3rem; border-radius: 4px; }
.reply > summary:hover { color: var(--accent); }
.reply[open] > summary { color: var(--ink); }
.reply form { margin: 0.4rem 0 0.5rem; }

.kids { margin-left: 0.2rem; padding-left: 1rem; border-left: 1px solid var(--line); transition: border-color 0.12s; }
.kids:not(:has(details)) { display: none; }
.c > summary:hover ~ .kids, .c:has(> .prose:hover) > .kids { border-left-color: var(--accent); }

/* group list */
.gtree { list-style: none; padding: 0; margin: 0; }
.gtree li { padding: 0.55rem 0 0.55rem calc(var(--depth) * 1.1rem); border-top: 1px solid var(--line); }
.gtree li > a { font-weight: 500; text-decoration: none; }
.gtree li > a:hover { color: var(--accent); }
.gtree p { margin: 0.1rem 0 0; color: var(--muted); font-size: 0.875rem; }
.meta-i { font-size: 0.8125rem; color: var(--muted); margin-left: 0.4rem; }

@media (hover: none) {
  .vote button, .acts { opacity: 1; pointer-events: auto; }
}

@media (max-width: 34rem) {
  .top { padding-top: 1.25rem; }
  .jump { order: 3; flex-basis: 100%; }
  .links { margin-left: auto; }
  .kids { padding-left: 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
