:root {
  --bg: #fdfdfc;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e6e4df;
  --accent: #002659;
  --max-width: 640px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --fg: #e9e8e4;
    --muted: #8f9096;
    --line: #2a2d33;
    --accent: #7ba3e0;
  }
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  padding: 0 24px;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
}

header.site {
  padding: 64px 0 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}

header.site .brand {
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

header.site nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  margin-left: 20px;
}

header.site nav a:hover {
  color: var(--fg);
}

main {
  padding-bottom: 80px;
}

h1 {
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

h1.title {
  margin-bottom: 4px;
}

.post-meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 40px;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  margin-bottom: 30px;
}

.post-list a.title-link {
  color: var(--fg);
  text-decoration: none;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.post-list a.title-link:hover {
  color: var(--accent);
}

.post-list .excerpt {
  color: var(--muted);
  margin: 4px 0 0;
  font-size: 15px;
}

.post-list .date {
  color: var(--muted);
  font-size: 13px;
  display: block;
  margin-bottom: 2px;
}

article p {
  margin: 0 0 20px;
}

article a {
  color: var(--accent);
}

article code {
  background: var(--line);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.9em;
}

article pre {
  background: var(--line);
  padding: 14px 16px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 14px;
}

article pre code {
  background: none;
  padding: 0;
}

article blockquote {
  border-left: 2px solid var(--line);
  margin: 0 0 20px;
  padding-left: 16px;
  color: var(--muted);
}

.back-link {
  display: inline-block;
  margin-bottom: 32px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

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

footer.site {
  border-top: 1px solid var(--line);
  padding: 32px 0 64px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
}

footer.site a {
  color: var(--muted);
}

footer.site a:hover {
  color: var(--fg);
}

.ask-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.ask-form textarea {
  font-family: inherit;
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  resize: vertical;
}

.ask-form button {
  align-self: flex-start;
  font-family: inherit;
  font-size: 15px;
  padding: 8px 20px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
}

.ask-form button:hover {
  opacity: 0.85;
}

.ask-form input[type="password"] {
  font-family: inherit;
  font-size: 15px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  max-width: 240px;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

#pending-list textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  resize: vertical;
  margin: 8px 0;
}

#pending-list button,
#answered-list button {
  font-family: inherit;
  font-size: 14px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
}

#pending-list .discard-btn,
#answered-list .delete-btn {
  color: var(--muted);
}
