:root {
  --bg: #0a0a0a;
  --bg-elev: #141414;
  --fg: #e8e8e8;
  --fg-dim: #9a9a9a;
  --fg-dimmer: #6a6a6a;
  --accent: #7ab;
  --accent-hover: #a2cee1;
  --border: #262626;
  --max-w: 680px;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, ui-serif, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.site-header {
  padding: 1.75rem 1.5rem;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: 0.02em;
}
.site-title:hover { color: var(--fg); }

.site-nav { display: flex; gap: 1.5rem; }
.site-nav a {
  color: var(--fg-dim);
  font-size: 0.9rem;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--fg); }

.site-main {
  flex: 1;
  padding: 3.5rem 1.5rem;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
}

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

.posts-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2.25rem;
}
.posts-header label {
  color: var(--fg-dimmer);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.posts-header select {
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  font-family: inherit;
  font-size: 0.85rem;
  border-radius: 4px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%239a9a9a' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 10px 6px;
  transition: border-color 0.15s ease;
}
.posts-header select:hover { border-color: var(--fg-dim); }
.posts-header select:focus {
  outline: none;
  border-color: var(--accent);
}

.post-header { margin-bottom: 2.5rem; }
.post-header h1 {
  font-family: var(--serif);
  font-size: 2.25rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.post-header time {
  color: var(--fg-dimmer);
  font-family: var(--mono);
  font-size: 0.85rem;
}

.post-content { font-size: 1.05rem; line-height: 1.75; }
.post-content p { margin-bottom: 1.25rem; }
.post-content a { border-bottom: 1px solid var(--accent); }

.post-content h2, .post-content h3, .post-content h4 {
  font-family: var(--serif);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  color: var(--fg);
}
.post-content h2 { font-size: 1.55rem; }
.post-content h3 { font-size: 1.25rem; }
.post-content h4 { font-size: 1.1rem; }

.post-content code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--bg-elev);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.post-content pre {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
.post-content pre code {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 1em;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: var(--fg-dim);
  margin: 1.5rem 0;
  font-style: italic;
}

.post-content ul, .post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.post-content li { margin-bottom: 0.25rem; }

.post-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.post-list { list-style: none; }
.post-list li {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.post-list li:last-child { border-bottom: 0; }
.post-list a {
  color: var(--fg);
  font-size: 1.1rem;
  transition: color 0.15s ease;
}
.post-list a:hover { color: var(--accent); }
.post-list time {
  color: var(--fg-dimmer);
  font-family: var(--mono);
  font-size: 0.85rem;
  white-space: nowrap;
}

.empty { color: var(--fg-dim); font-style: italic; }

.site-footer {
  padding: 2.5rem 1.5rem 2rem;
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  color: var(--fg-dimmer);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-nostr span { font-family: var(--mono); }
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { color: var(--fg-dim); }
.footer-links a:hover { color: var(--fg); }

@media (max-width: 640px) {
  html { font-size: 16px; }
  .site-header {
    padding: 1.25rem 1.25rem;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
  .site-main { padding: 2.5rem 1.25rem; }
  .post-header h1 { font-size: 1.85rem; }
  .posts-index h1 { font-size: 1.75rem; }
  .site-footer {
    padding: 2rem 1.25rem;
    flex-direction: column;
    align-items: flex-start;
  }
}

::selection {
  background: var(--accent);
  color: var(--bg);
}
