:root {
  --bg: #0d0d14;
  --text: #b8b8c8;
  --text-dim: #6a6a7a;
  --text-bright: #e6e6f0;
  --accent: #00d9ff;
  --accent-2: #ff2e97;
  --border: rgba(0, 217, 255, 0.12);
  --glow: rgba(0, 217, 255, 0.4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(13,13,20,0.85), rgba(13,13,20,0.95)),
    url('/assets/bg.jpg');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0,217,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,217,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -1;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
a:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); }

.site-header, main, .site-footer {
  width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px;
}
.site-header {
  padding-top: 32px; padding-bottom: 24px;
  border-bottom: 1px solid var(--border); margin-bottom: 32px;
}
.site-title {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.35em; font-weight: 600; letter-spacing: .02em;
  color: var(--text); text-shadow: 0 0 12px var(--glow);
  border: none;
}
.site-title:hover {
  color: var(--accent);
  text-shadow: 0 0 16px var(--glow), 0 0 32px rgba(0,217,255,.2);
}
.site-tagline {
  margin: 6px 0 0; font-size: .85em; color: var(--text-dim);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

main { flex: 1 0 auto; padding-bottom: 40px; }

.post {
  margin-bottom: 40px; padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.post:last-of-type { border-bottom: none; }
.post time {
  display: block;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .78em; color: var(--text-dim);
  letter-spacing: .03em; margin-bottom: 6px;
}
.post h2 {
  margin: 0 0 16px; font-size: 1.5em; line-height: 1.3;
  color: var(--text-bright); font-weight: 600;
}

.post-content > * { margin: 12px 0; }
.post-content > *:first-child { margin-top: 0; }
.post-content > *:last-child { margin-bottom: 0; }
.post-content h3, .post-content h4 { color: var(--text-bright); margin: 24px 0 10px; line-height: 1.35; }
.post-content h3 { font-size: 1.15em; }
.post-content h4 { font-size: 1.02em; }

.post-content code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .9em; padding: 2px 6px;
  background: rgba(0,217,255,.08);
  border: 1px solid var(--border); border-radius: 3px;
  color: var(--accent);
}
.post-content pre {
  background: rgba(0,0,0,.35); border: 1px solid var(--border);
  border-radius: 4px; padding: 12px 14px; overflow-x: auto;
  font-size: .88em; line-height: 1.5;
}
.post-content pre code {
  background: none; border: none; padding: 0; color: var(--text);
}
.post-content blockquote {
  margin: 16px 0; padding: 6px 16px;
  border-left: 2px solid var(--accent-2);
  color: var(--text-dim); font-style: italic;
}
.post-content ul, .post-content ol { padding-left: 22px; margin: 12px 0; }
.post-content li { margin: 4px 0; }
.post-content hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

.post-content img, .post-content video {
  max-width: 100%; height: auto; display: block;
  margin: 16px auto;
  border: 1px solid var(--border); border-radius: 4px;
}
.post-content img.align-left, .post-content video.align-left {
  margin-left: 0; margin-right: auto;
}
.post-content img.align-right, .post-content video.align-right {
  margin-left: auto; margin-right: 0;
}
.post-content img.align-center, .post-content video.align-center {
  margin-left: auto; margin-right: auto;
}

.post-content mark {
  background: rgba(0, 217, 255, 0.18);
  color: var(--text-bright);
  padding: 1px 4px; border-radius: 2px;
}
.post-content del { color: var(--text-dim); }

.post-content table {
  border-collapse: collapse; margin: 16px 0;
  font-size: .92em; width: 100%;
}
.post-content th, .post-content td {
  border: 1px solid var(--border);
  padding: 6px 10px; text-align: left;
}
.post-content th { background: rgba(0,217,255,.06); color: var(--text-bright); }

.pagination {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; margin-top: 40px; padding-top: 20px;
  border-top: 1px solid var(--border);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .9em;
}
.pagination a {
  padding: 8px 14px;
  border: 1px solid var(--border); border-radius: 3px;
}
.pagination a:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0,217,255,.15);
}
.pagination .placeholder { visibility: hidden; }
.pagination .pager-info { color: var(--text-dim); font-size: .85em; }

.site-footer {
  flex-shrink: 0;
  padding-top: 20px; padding-bottom: 24px;
  border-top: 1px solid var(--border); margin-top: 20px;
  font-size: .85em; color: var(--text-dim);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }

.footer-main {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-legal {
  margin: 0;
  max-width: 560px;
  text-align: center;
  line-height: 1.5;
  font-size: .95em;
  color: var(--text-dim);
}

@media (max-width: 600px) {
  .site-header, main, .site-footer { padding-left: 14px; padding-right: 14px; }
  .site-header { padding-top: 20px; padding-bottom: 18px; margin-bottom: 20px; }
  .site-title { font-size: 1.15em; }
  .post h2 { font-size: 1.2em; }
  .post { margin-bottom: 28px; padding-bottom: 22px; }
  .pagination { flex-direction: column; gap: 10px; }
  .pagination .placeholder { display: none; }
  .pagination .pager-info { order: 2; }
  .footer-legal { font-size: .9em; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .site-header { padding-top: 12px; padding-bottom: 10px; margin-bottom: 14px; }
  .site-tagline { display: none; }
  .post { margin-bottom: 20px; padding-bottom: 16px; }
}