:root {
  --bg-primary: #0a0e27;
  --bg-secondary: #111538;
  --bg-card: #1a1f4e;
  --text-primary: #e8e6f0;
  --text-secondary: #9a98b0;
  --accent: #4fc3f7;
  --accent-dim: #2ebceb80;
  --border: #28a3cc40;
  --red: #ff5f58;
  --yellow: #ffbd2e;
  --green: #18c132;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', Oxygen, Ubuntu, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-brand:hover {
  opacity: 0.85;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* --- Post listing (homepage) --- */

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

.post-list-item {
  margin-bottom: 1.25rem;
}

.post-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color 0.2s, transform 0.15s;
}

.post-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
}

.post-card h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.post-card .post-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.post-card .post-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --- Post window --- */

.post-window {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.window-bar {
  background: var(--bg-secondary);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.red { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green { background: var(--green); }

.window-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex: 1;
}

.post-content {
  padding: 2rem;
}

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

.post-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

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

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

/* --- Post content typography --- */

.post-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  color: var(--text-primary);
}

.post-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-primary);
}

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

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content a:hover {
  opacity: 0.85;
}

.post-content strong {
  font-weight: 600;
}

.post-content code {
  background: var(--bg-secondary);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

.post-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.post-content blockquote {
  border-left: 3px solid var(--accent-dim);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: 0 8px 8px 0;
}

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

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

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

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

.post-content big {
  font-size: 1.3em;
}

.post-content big big big {
  font-size: 2.5em;
  line-height: 1;
  float: left;
  margin-right: 0.15em;
}

/* --- Footer --- */

.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* --- About page --- */

.about-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  line-height: 1.7;
}

.about-content h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* --- Responsive --- */

@media (max-width: 640px) {
  .nav-inner {
    padding: 0 1rem;
  }

  .container {
    padding: 1rem;
  }

  .post-content {
    padding: 1.25rem;
  }

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

  .post-content pre {
    margin: 1rem -0.25rem;
    border-radius: 6px;
  }
}
