/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg-primary: #0a0e1a;
  --bg-surface: #0f1629;
  --bg-hover: #162038;
  --border: #1a2744;
  --border-accent: #1e3a5f;

  --cyan: #00d4ff;
  --cyan-dim: #0099bb;
  --cyan-glow: rgba(0, 212, 255, 0.15);
  --green: #39ff14;
  --green-dim: #28bb0f;
  --amber: #ffaa00;
  --red: #ff3344;

  --text-primary: #e2e8f0;
  --text-secondary: #a8b8cc;
  --text-muted: #6b7a96;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', 'Courier New', monospace;

  --max-width: 720px;
  --header-height: 64px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(0, 212, 255, 0.25);
  color: var(--text-primary);
}

/* === Container === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* === Header === */
.site-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: rgba(10, 14, 26, 0.85);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 24px;
  height: 24px;
  border: 2px solid var(--cyan);
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: box-shadow 0.3s ease;
}

.site-logo:hover .logo-icon {
  box-shadow: 0 0 12px var(--cyan-glow), 0 0 4px var(--cyan);
}

.logo-text {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

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

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

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

/* === Main === */
main {
  flex: 1;
  padding: 3rem 0;
}

/* === Hero === */
.hero {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.hero-title {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 540px;
}

/* === Post List === */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-card {
  border-bottom: 1px solid var(--border);
}

.post-card a {
  display: block;
  padding: 1.5rem 0;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.post-card a:hover {
  background: transparent;
}

.post-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
  line-height: 1.4;
}

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

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.post-card-meta .post-author::after {
  content: '/';
  margin-left: 1rem;
  color: var(--border-accent);
}

.post-card-summary {
  margin-top: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* === Single Post === */
.post {
  max-width: 100%;
}

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

.post-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.post-meta .post-author::after {
  content: '/';
  margin-left: 1rem;
  color: var(--border-accent);
}

/* === Post Content === */
.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.post-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

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

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

.post-content a {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px dotted var(--cyan-dim);
  transition: border-color 0.2s ease;
}

.post-content a:hover {
  border-bottom-style: solid;
}

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

.post-content em {
  color: var(--text-primary);
  font-style: italic;
}

.post-content blockquote {
  border-left: 3px solid var(--cyan-dim);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--bg-surface);
  border-radius: 0 6px 6px 0;
  color: var(--text-secondary);
}

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

.post-content blockquote em {
  color: var(--cyan);
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--green);
}

.post-content pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

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

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

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

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

/* === Post Footer === */
.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.back-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: auto;
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-accent);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cyan-dim);
}

/* === Responsive === */
@media (max-width: 640px) {
  .post-title {
    font-size: 1.5rem;
  }

  .hero-title {
    font-size: 1.35rem;
  }

  .post-card-meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .post-meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  main {
    padding: 2rem 0;
  }
}
