:root {
  color-scheme: light dark;
  --fg: #1a1a1a;
  --bg: #fafafa;
  --muted: #6b6b6b;
  --accent: #8b3a3a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6e6e6;
    --bg: #181818;
    --muted: #999999;
    --accent: #d98a8a;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2.5rem 1.25rem;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.container {
  max-width: 40rem;
  margin: 0 auto;
}

header h1 {
  font-size: 1.1rem;
  margin: 0 0 2rem 0;
}

header h1 a {
  color: var(--fg);
  text-decoration: none;
}

.search-input {
  display: block;
  width: 100%;
  margin-bottom: 2rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--muted);
  border-radius: 0.25rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.surprise-box {
  margin-bottom: 2rem;
}

.surprise-btn {
  font: inherit;
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent);
  border-radius: 0.25rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}

.surprise-btn:hover {
  color: var(--bg);
  background: var(--accent);
}

.surprise-result:not(:empty) {
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}

.surprise-result p {
  margin: 0 0 0.5rem 0;
}

.postlist article {
  margin-bottom: 1.5rem;
}

.postlist h2 {
  font-size: 1.1rem;
  margin: 0 0 0.25rem 0;
  font-weight: normal;
}

.postlist h2 a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--muted);
}

time {
  display: block;
  margin: 0.5rem 0 1.5rem 0;
  font-style: normal;
  color: var(--muted);
  font-size: 0.85rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

article h2 {
  font-size: 1.4rem;
  margin-bottom: 0;
}

article p {
  margin: 1rem 0;
}

article ul,
article ol {
  margin: 1rem 0;
  padding-left: 1.25rem;
}

article li {
  margin: 0.6rem 0;
}

article blockquote {
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

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