/* Thwack — quiet, monochrome, museum-like. */
:root {
  --bg: #fafaf8;
  --ink: #141414;
  --muted: #6e6e6a;
  --hair: #d9d9d4;
  --panel: #ffffff;
  --accent: #3d3d3a;
  --warn: #8a5a00;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161614;
    --ink: #e8e8e4;
    --muted: #9a9a94;
    --hair: #33332f;
    --panel: #1d1d1b;
    --accent: #c9c9c2;
    --warn: #d9a84e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding: 0 16px env(safe-area-inset-bottom, 0);
}
h1, h2, h3, cite, .wordmark {
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-weight: 400;
  letter-spacing: 0.01em;
}
cite { font-style: italic; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

/* Header / footer */
header.site {
  max-width: 980px; margin: 0 auto; padding: 22px 0 18px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--hair);
}
.wordmark { font-size: 22px; text-decoration: none; letter-spacing: 0.04em; }
header.site nav { display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap; }
header.site nav a, .linklike {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  text-decoration: none; color: var(--muted);
}
header.site nav a:hover, .linklike:hover { color: var(--ink); }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
footer.site {
  max-width: 980px; margin: 48px auto 0; padding: 18px 0 32px;
  border-top: 1px solid var(--hair); color: var(--muted); font-size: 12.5px;
}

main { max-width: 980px; margin: 0 auto; }
.page-head { padding: 34px 0 6px; }
.page-head h1 { font-size: 30px; margin: 0 0 6px; }
.muted { color: var(--muted); font-size: 13px; }
.warn { color: var(--warn); font-size: 12.5px; }
.empty { color: var(--muted); font-style: italic; margin: 6px 0; }

/* Dashboard layout */
.columns { display: flex; gap: 40px; align-items: flex-start; }
.col-main { flex: 2 1 480px; min-width: 0; }
.col-side { flex: 1 1 240px; min-width: 0; }
@media (max-width: 760px) { .columns { flex-direction: column; } .col-side, .col-main { width: 100%; flex: none; } }

section.panel { padding: 22px 0 10px; border-bottom: 1px solid var(--hair); }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
section.panel h2 {
  font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px; font-family: inherit;
}

/* Row lists */
ul.rows { list-style: none; margin: 0; padding: 0; }
ul.rows li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--hair); flex-wrap: wrap;
}
ul.rows li:first-child { border-top: 0; }
.row-actions { display: flex; gap: 10px; align-items: baseline; }
ul.feed li { display: block; }
ul.feed li .muted { margin-left: 8px; }

/* Buttons & forms */
button, .button {
  font: inherit; font-size: 13px; letter-spacing: 0.06em;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--ink); border-radius: 0;
  padding: 8px 18px; cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover, .button:hover { background: var(--ink); color: var(--bg); }
button.small { padding: 3px 12px; font-size: 12px; border-color: var(--hair); color: var(--muted); }
button.small:hover { border-color: var(--ink); color: var(--bg); background: var(--ink); }
button.danger { border-color: var(--warn); color: var(--warn); }
button.danger:hover { background: var(--warn); color: var(--bg); }
textarea {
  width: 100%; font: inherit; font-size: 14.5px; line-height: 1.6;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--hair); padding: 12px; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); }
.stack { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin: 10px 0; }
.stack button { align-self: flex-end; }
.gate-msg { border: 1px solid var(--warn); color: var(--warn); padding: 10px 14px; font-size: 13.5px; }

/* Landing */
.landing { max-width: 640px; margin: 0 auto; padding: 80px 0 40px; text-align: center; }
.landing h1 { font-size: 54px; margin: 0 0 18px; letter-spacing: 0.02em; }
.lede { font-size: 17px; color: var(--muted); margin: 0 auto 28px; max-width: 46ch; }
.landing-points { list-style: none; padding: 28px 0 0; margin: 28px 0 0; border-top: 1px solid var(--hair); color: var(--muted); font-size: 13.5px; }
.landing-points li { padding: 4px 0; }

/* Reading page */
article.work, article.thread { max-width: 680px; margin: 0 auto; }
.work-head { padding: 40px 0 8px; border-bottom: 1px solid var(--hair); margin-bottom: 28px; }
.work-head h1 { font-size: 34px; margin: 0 0 8px; }
.prose { font-family: Georgia, "Times New Roman", "Noto Serif", serif; font-size: 17px; line-height: 1.75; }
.prose p { margin: 0 0 1em; }
.prose h1, .prose h2, .prose h3 { font-weight: 400; }
.prose blockquote { margin: 1em 0; padding-left: 1.2em; border-left: 2px solid var(--hair); color: var(--muted); }
article.work + section.panel, article.thread { margin-top: 40px; }
article.work ~ section.panel { max-width: 680px; margin-left: auto; margin-right: auto; }
.assigned-note { font-size: 13.5px; color: var(--muted); border: 1px solid var(--hair); padding: 10px 14px; }

/* Review thread */
ol.messages { list-style: none; margin: 0 0 24px; padding: 0; }
ol.messages li { padding: 14px 0; border-top: 1px solid var(--hair); }
ol.messages li:first-child { border-top: 0; }
.msg-meta { margin: 0 0 4px; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
li.mine .msg-meta::after { content: " — you"; }
.msg-body { margin: 0; white-space: pre-wrap; }

/* Confirm dialog */
dialog#confirm {
  border: 1px solid var(--ink); background: var(--panel); color: var(--ink);
  padding: 26px 28px; max-width: 420px; width: calc(100vw - 48px);
}
dialog#confirm::backdrop { background: rgba(0, 0, 0, 0.45); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
