/* ============================================================
   KlarPCR — Tech Founder / AI Automation
   Dark minimal · sharp · engineering-forward
   ============================================================ */

/* ─── Design Tokens ─── */
:root {
  --font-sans: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  --c-bg:       #0D1117;
  --c-surface:  #161B22;
  --c-surface2: #1C2230;
  --c-border:   #21262D;
  --c-border2:  #30363D;
  --c-text:     #E6EDF3;
  --c-text-2:   #7D8590;
  --c-text-3:   #3D444D;
  --c-accent:   #2F81F7;
  --c-accent-g: #58A6FF;
  --c-green:    #3FB950;
  --w-content:  740px;
  --radius:     6px;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; padding: 0; margin: 0; }

/* ─── Layout ─── */
.container {
  width: 100%;
  max-width: calc(var(--w-content) + 80px);
  margin: 0 auto;
  padding: 0 40px;
}
.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; padding: 0 0 96px; }

/* ─── Header ─── */
.site-header {
  background: rgba(13,17,23,0.95);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.admin-bar .site-header { top: 32px; }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.site-branding { flex-shrink: 0; }
.site-title a {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 0;
}
.site-title a::before {
  content: '~/';
  color: var(--c-accent-g);
}
.site-description { display: none; }
.primary-nav ul { display: flex; gap: 24px; align-items: center; }
.primary-nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-2);
  transition: color 0.15s;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a { color: var(--c-text); }
.nav-toggle { display: none; }

/* ─── Hero ─── */
.hero-section {
  padding: 72px 40px 56px;
  max-width: calc(var(--w-content) + 80px);
  margin: 0 auto;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 40px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-green);
  border: 1px solid rgba(63,185,80,0.3);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 28px;
  background: rgba(63,185,80,0.06);
}
.hero-badge-dot {
  width: 7px; height: 7px;
  background: var(--c-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero-title {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--c-text);
  margin-bottom: 20px;
}
.hero-title-accent {
  color: var(--c-accent-g);
  font-weight: 400;
}
.hero-desc {
  font-size: 15px;
  color: var(--c-text-2);
  line-height: 1.75;
  max-width: 520px;
  margin-bottom: 28px;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-text-2);
  background: var(--c-surface);
  border: 1px solid var(--c-border2);
  padding: 4px 10px;
  border-radius: 4px;
}

/* ─── Section label ─── */
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-text-3);
  max-width: calc(var(--w-content) + 80px);
  margin: 0 auto 16px;
  padding: 0 40px;
}

/* ─── Post list ─── */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 40px;
  max-width: calc(var(--w-content) + 80px);
  margin: 0 auto;
}

/* ─── Post card ─── */
.post-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}
.post-item:hover {
  border-color: var(--c-border2);
  transform: translateY(-1px);
}

.post-thumbnail { display: block; overflow: hidden; }
.post-thumbnail-inner {
  position: relative;
  height: 190px;
  overflow: hidden;
}
.post-thumbnail-inner img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  transition: transform 0.5s ease;
  filter: brightness(0.75) saturate(0.9);
}
.post-item:hover .post-thumbnail-inner img {
  transform: scale(1.04);
  filter: brightness(0.85) saturate(1);
}

.post-card-body { padding: 18px 20px 20px; }

.post-overline {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-text-3);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.post-overline a { color: var(--c-accent-g); }
.post-overline a:hover { text-decoration: underline; }

.post-item .post-title { margin-bottom: 8px; }
.post-item .post-title a {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--c-text);
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}
.post-item:hover .post-title a { color: var(--c-accent-g); }

.post-excerpt {
  font-size: 13px;
  line-height: 1.7;
  color: var(--c-text-2);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--c-accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: gap 0.2s, color 0.15s;
}
.read-more::after { content: '→'; }
.read-more:hover { gap: 8px; color: var(--c-accent-g); }

/* ─── Single post ─── */
.post-header { margin-bottom: 36px; padding-top: 48px; }
.post-display-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.post-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-text-3);
  display: flex; flex-wrap: wrap; gap: 16px;
}
.post-featured-image { margin: 28px 0; border-radius: var(--radius); overflow: hidden; }
.post-featured-image img { width: 100%; filter: brightness(0.85); }
.entry-content { font-size: 15px; line-height: 1.85; color: var(--c-text); }
.entry-content > * + * { margin-top: 20px; }
.entry-content h2 { font-size: 21px; font-weight: 700; margin-top: 40px; letter-spacing: -0.01em; }
.entry-content h3 { font-size: 17px; font-weight: 600; margin-top: 32px; }
.entry-content a { color: var(--c-accent-g); border-bottom: 1px solid rgba(88,166,255,0.25); }
.entry-content a:hover { border-color: var(--c-accent-g); }
.entry-content ul, .entry-content ol { padding-left: 24px; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin-bottom: 6px; }
.entry-content blockquote {
  border-left: 2px solid var(--c-accent);
  padding: 12px 20px;
  color: var(--c-text-2);
  background: var(--c-surface2);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.entry-content pre {
  background: var(--c-surface);
  border: 1px solid var(--c-border2);
  padding: 18px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: #c9d1d9;
}
.entry-content code {
  background: var(--c-surface2);
  border: 1px solid var(--c-border2);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-accent-g);
}
.post-navigation {
  display: flex; justify-content: space-between; gap: 24px;
  margin-top: 56px; padding-top: 28px;
  border-top: 1px solid var(--c-border);
}
.nav-label { font-family: var(--font-mono); font-size: 11px; color: var(--c-text-3); margin-bottom: 6px; }
.nav-post-title { font-size: 14px; font-weight: 500; color: var(--c-text-2); }
.nav-post-title:hover { color: var(--c-accent-g); }
.nav-next { text-align: right; }

/* ─── Page ─── */
.page-title {
  font-size: 24px; font-weight: 700; letter-spacing: -0.01em;
  margin-bottom: 28px; padding-bottom: 20px;
  border-bottom: 1px solid var(--c-border);
}

/* ─── Single wrap ─── */
.single-wrap {
  max-width: calc(var(--w-content) + 80px);
  margin: 0 auto;
  padding: 0 40px 96px;
}
.single-wrap .post-header { padding-top: 48px; }
.single-wrap .content-wrap { padding: 0; max-width: 100%; }
.post-tags { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--c-border); }
.post-tags-label { font-family: var(--font-mono); font-size: 11px; color: var(--c-text-3); margin-bottom: 10px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--c-text-2); background: var(--c-surface);
  border: 1px solid var(--c-border2); padding: 4px 10px;
  border-radius: 4px; transition: border-color 0.15s, color 0.15s;
}
.tag-chip:hover { border-color: var(--c-accent); color: var(--c-accent-g); }
@media (max-width: 768px) { .single-wrap { padding-left: 20px; padding-right: 20px; } }

/* ─── Footer ─── */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: 20px 0;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.footer-copy { font-family: var(--font-mono); font-size: 11px; color: var(--c-text-3); }
.footer-nav ul { display: flex; gap: 20px; }
.footer-nav a { font-size: 13px; color: var(--c-text-3); }
.footer-nav a:hover { color: var(--c-text-2); }

/* ─── Pagination ─── */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 40px auto; max-width: calc(var(--w-content) + 80px); padding: 0 40px; }
.pagination .page-numbers {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-border); font-size: 13px; color: var(--c-text-2);
  border-radius: var(--radius); background: var(--c-surface); transition: border-color 0.15s, color 0.15s;
}
.pagination .page-numbers:hover { border-color: var(--c-border2); color: var(--c-text); }
.pagination .page-numbers.current { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }

/* ─── 404 / No posts ─── */
.error-404 { text-align: center; padding: 80px 0; }
.error-code { font-family: var(--font-mono); font-size: 96px; color: var(--c-border2); line-height: 1; }
.no-results { text-align: center; padding: 60px 0; color: var(--c-text-3); }

/* ─── Admin bar ─── */
@media screen and (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

/* ─── Mobile ─── */
@media (max-width: 768px) {
  .container, .hero-section, .section-label, .posts-list { padding-left: 20px; padding-right: 20px; }
  .hero-section { padding-top: 48px; padding-bottom: 40px; }
  .hero-title { font-size: 28px; }
  .primary-nav { display: none; }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
  }
  .nav-toggle-bar { display: block; width: 20px; height: 1.5px; background: var(--c-text-2); border-radius: 1px; }
  .primary-nav.is-open {
    display: block; position: absolute; top: 56px; left: 0; right: 0;
    background: var(--c-surface); border-bottom: 1px solid var(--c-border);
    padding: 16px 20px; z-index: 99;
  }
  .primary-nav.is-open ul { flex-direction: column; gap: 0; }
  .primary-nav.is-open a { display: block; padding: 12px 0; border-bottom: 1px solid var(--c-border); }
  .post-thumbnail-inner { height: 160px; }
  .post-display-title { font-size: 24px; }
  .post-navigation { flex-direction: column; }
  .nav-next { text-align: left; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 24px; }
  .post-thumbnail-inner { height: 140px; }
}
