/* Haplab Blog */

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

:root {
  --amber: #e8a020;
  --amber-light: #d0b860;
  --amber-dim: #a08838;
  --bg: #0a0a0a;
  --bg-code: #1a1816;
  --text: #d4d4d4;
  --text-muted: #8a8a90;
  --text-heading: #f0f0f0;
  --border: #262320;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Consolas', monospace;
  --content-width: 680px;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.72;
  min-height: 100vh;
}

/* ---- Header ---- */

.site-header {
  padding: 2.5rem 1.5rem 2rem;
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-heading);
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-title .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--amber);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 8px rgba(232, 160, 32, 0.35);
}

.site-nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.2s;
}

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

/* ---- Main ---- */

main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

/* ---- Footer ---- */

.site-footer {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ---- Index: Post List ---- */

.post-list {
  list-style: none;
}

.post-list li {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:first-child {
  padding-top: 0;
}

.post-list li:last-child {
  border-bottom: none;
}

.post-title {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 0.2rem;
  line-height: 1.35;
}

.post-title a {
  color: var(--text-heading);
  text-decoration: none;
  transition: color 0.2s;
}

.post-title a:hover {
  color: var(--amber);
}

.post-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-desc {
  font-size: 0.9rem;
  color: #9a9a9e;
  line-height: 1.5;
  margin-top: 0.3rem;
}

/* ---- Post Page ---- */

.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-heading);
  margin-bottom: 0.5rem;
}

.post-header .post-meta {
  font-size: 0.85rem;
}

/* ---- Article Typography ---- */

.post-content h2 {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  margin: 2.75rem 0 1rem;
}

.post-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 2rem 0 0.75rem;
}

.post-content p {
  margin-bottom: 1.3rem;
}

.post-content a {
  color: var(--amber);
  text-decoration: underline;
  text-decoration-color: rgba(232, 160, 32, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}

.post-content a:hover {
  text-decoration-color: var(--amber);
}

.post-content strong {
  color: var(--text-heading);
  font-weight: 600;
}

/* Lists */

.post-content ul,
.post-content ol {
  margin: 0 0 1.3rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.35rem;
}

.post-content li::marker {
  color: var(--amber-dim);
}

/* Blockquote */

.post-content blockquote {
  border-left: 3px solid var(--amber-dim);
  padding: 0.8rem 1.25rem;
  margin: 1.75rem 0;
  color: #b0b0b6;
  background: rgba(232, 160, 32, 0.025);
  border-radius: 0 4px 4px 0;
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Inline code */

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

/* Code blocks */

.post-content pre {
  margin: 1.75rem 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.post-content pre code {
  display: block;
  padding: 1.25rem 1.5rem;
  background: var(--bg-code);
  border: none;
  font-size: 0.82rem;
  line-height: 1.65;
  border-radius: 6px;
}

/* Prism.js overrides to match our palette */

.post-content pre[class*="language-"],
.post-content code[class*="language-"] {
  background: var(--bg-code);
  border: none;
}

.post-content pre[class*="language-"] {
  background: var(--bg-code);
}

/* Horizontal rule */

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

/* Images */

.post-content img {
  max-width: 100%;
  border-radius: 6px;
  margin: 1.5rem 0;
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  .site-header {
    padding: 1.75rem 1.25rem 1.5rem;
  }

  main {
    padding: 0 1.25rem 3rem;
  }

  .site-footer {
    padding: 1.5rem 1.25rem;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .post-header h1 {
    font-size: 1.7rem;
  }

  .post-content pre code {
    padding: 1rem 1.15rem;
    font-size: 0.78rem;
  }

  .post-list li {
    padding: 1.25rem 0;
  }
}
