:root {
  --fg: #000;
  --bg: #fff;
  --muted: #666;
  --line: #000;
  --line-soft: #ddd;
  --accent-bg: #000;
  --accent-fg: #fff;
  --maxw: 880px;
  --pad: 24px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
}

.hidden { display: none !important; }

a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover { text-decoration: none; }

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px var(--pad) 120px;
}

header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
  margin-bottom: 28px;
}

header h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px 0;
}

header .subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  margin-bottom: -1px;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}

.tab[aria-selected="true"] {
  color: var(--fg);
  border-bottom-color: var(--fg);
  font-weight: 600;
}

.sort {
  margin-left: auto;
  padding: 6px 0;
  font-size: 13px;
  color: var(--muted);
}

.sort select {
  font: inherit;
  font-size: 13px;
  background: none;
  border: 1px solid var(--line-soft);
  padding: 3px 6px;
  margin-left: 4px;
  color: var(--fg);
}

.posts {
  display: flex;
  flex-direction: column;
}

.post {
  border-bottom: 1px solid var(--line-soft);
  padding: 18px 0;
  cursor: pointer;
}

.post:hover .post-name {
  text-decoration: underline;
}

.post-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
}

.post-name {
  font-weight: 600;
  font-size: 16px;
}

.post-meta {
  color: var(--muted);
  font-size: 13px;
}

.post-meta span + span::before {
  content: " · ";
  margin: 0 4px;
}

.post-summary {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.post-body {
  margin-top: 14px;
  font-size: 14px;
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 16px;
  row-gap: 6px;
  border-left: 2px solid var(--line);
  padding-left: 14px;
}

.post-body dt {
  color: var(--muted);
  font-size: 13px;
  text-transform: lowercase;
}
.post-body dd {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.post-body .takedown {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  grid-column: 1 / -1;
}

.empty {
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.floating {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--accent-bg);
  color: var(--accent-fg);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 0 0 var(--line);
}
.floating:hover { transform: translateY(-1px); }
.floating:active { transform: translateY(0); box-shadow: none; }

footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px var(--pad) 60px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line-soft);
}
footer p { margin: 0; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}

.modal-inner {
  background: var(--bg);
  border: 1px solid var(--line);
  width: 100%;
  max-width: 540px;
  padding: 28px 24px 24px;
  position: relative;
}

.modal h2 {
  margin: 0 0 18px 0;
  font-size: 20px;
}

.modal .close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--fg);
  line-height: 1;
}

form fieldset {
  border: 1px solid var(--line-soft);
  padding: 10px 14px;
  margin: 0 0 14px 0;
}
form legend {
  font-size: 13px;
  color: var(--muted);
  padding: 0 6px;
}

form label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

form label.radio,
form label.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 16px;
  margin-bottom: 0;
  color: var(--fg);
  font-size: 14px;
}

form label.checkbox {
  display: flex;
  margin-bottom: 12px;
}

form input[type=text],
form input[type=number],
form input[type=date],
form input[type=url],
form input[type=password],
form select,
form textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line-soft);
  padding: 8px 10px;
  margin-top: 4px;
}

form textarea {
  resize: vertical;
  font-family: inherit;
}

form input:focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: var(--fg);
}

form .row {
  display: flex;
  gap: 12px;
}
form .row > label { flex: 1; }

form .actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

button {
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--line);
  background: var(--accent-bg);
  color: var(--accent-fg);
  padding: 8px 18px;
  cursor: pointer;
}

button:hover { opacity: 0.85; }

button.secondary {
  background: var(--bg);
  color: var(--fg);
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.error {
  color: #b00020;
  font-size: 13px;
  margin: 8px 0 0 0;
}

.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.gate-inner {
  max-width: 360px;
  width: 100%;
}
.gate h1 {
  margin: 0 0 6px;
  font-size: 22px;
}
.gate p {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 18px;
}
.gate form {
  display: flex;
  gap: 8px;
}
.gate input {
  flex: 1;
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--line);
  padding: 8px 10px;
}

@media (max-width: 600px) {
  main { padding: 36px 18px 100px; }
  header h1 { font-size: 24px; }
  .tabs { flex-wrap: wrap; }
  .sort { margin-left: 0; width: 100%; }
  form .row { flex-direction: column; gap: 0; }
  .floating { right: 16px; bottom: 16px; }
}
