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

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent-1: #8B5CF6;
  --accent-2: #3B82F6;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --radius-lg: 20px;
  --max-width: 1100px;
  --content-width: 720px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ─── GRADIENT TEXT ─── */

.gradient-text {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── NAVBAR ─── */

.navbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(139, 92, 246, 0.12), 0 4px 24px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

.nav-back {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.nav-back:hover {
  color: var(--accent-1);
}

.nav-logo {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-spacer {
  flex: 0 0 auto;
  width: 120px;
}

/* ─── MAIN ─── */

.site-main {
  flex: 1;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* ─── BLOG HERO ─── */

.blog-hero {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.blog-title {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.blog-desc {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

.tag-hero {
  display: inline-block;
  margin-bottom: 1rem;
}

/* ─── POST GRID ─── */

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* ─── POST CARD ─── */

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.post-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 92, 246, 0.08);
}

.post-card:hover::before {
  opacity: 1;
}

.post-card-image-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .post-card-image {
  transform: scale(1.04);
}

.post-card-content {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-1);
  text-decoration: none;
  margin-bottom: 0.5rem;
}

.post-card-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  flex: 1;
}

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

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

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

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

.meta-dot {
  color: var(--text-muted);
}

/* ─── PAGINATION ─── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.pagination-btn {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.pagination-btn:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}

.pagination-info {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ─── SINGLE POST ─── */

.post-full {
  max-width: var(--content-width);
  margin: 0 auto;
}

.post-full-header {
  margin-bottom: 2rem;
}

.post-full-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0.75rem 0 1rem;
}

.post-full-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.post-full-image {
  margin: 0 0 2.5rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.post-full-image img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 520px;
  object-fit: cover;
}

.post-full-image figcaption {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 0.5rem 1rem 0;
}

/* ─── POST CONTENT ─── */

.gh-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.gh-content h1,
.gh-content h2,
.gh-content h3,
.gh-content h4 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
}

.gh-content h2 { font-size: 1.625rem; }
.gh-content h3 { font-size: 1.25rem; }
.gh-content h4 { font-size: 1.0625rem; }

.gh-content p { margin-bottom: 1.5rem; }

.gh-content a {
  color: var(--accent-1);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gh-content a:hover { color: var(--accent-2); }

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

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

.gh-content li { margin-bottom: 0.4rem; }

.gh-content blockquote {
  border-left: 3px solid var(--accent-1);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(139, 92, 246, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-primary);
  font-style: italic;
}

.gh-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.gh-content code {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  font-size: 0.875em;
}

.gh-content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.gh-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 1rem 0;
}

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

.gh-content figure { margin: 1.5rem 0; }

.gh-content figcaption {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ─── POST FOOTER ─── */

.post-full-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.post-tags .post-tag {
  padding: 0.3rem 0.75rem;
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 100px;
  font-size: 0.8rem;
  margin: 0;
}

.post-tags .post-tag:hover {
  background: rgba(139, 92, 246, 0.1);
}

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

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

/* ─── FOOTER ─── */

.footer {
  text-align: center;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8125rem;
  position: relative;
  z-index: 1;
}

.footer a {
  color: var(--accent-1);
  text-decoration: none;
}

.footer a:hover { text-decoration: underline; }

/* ─── GHOST KOENIG CARD WIDTHS ─── */

.kg-width-wide {
  margin-left: calc(50% - 50vw + 2rem);
  margin-right: calc(50% - 50vw + 2rem);
  max-width: calc(100vw - 4rem);
}

.kg-width-full {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  max-width: 100vw;
}

.kg-image-card img,
.kg-gallery-card img {
  border-radius: var(--radius);
}

.kg-embed-card {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}

.kg-embed-card iframe {
  max-width: 100%;
}

/* ─── RESPONSIVE ─── */

@media (max-width: 768px) {
  .navbar {
    padding: 0.75rem 1rem;
  }

  .nav-spacer { display: none; }

  .site-main {
    padding: 2rem 1rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .post-full-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .blog-title { font-size: 2rem; }
  .post-full-title { font-size: 1.75rem; }
  .gh-content { font-size: 1rem; }
}
