/* ============================================================
   Design tokens
   ============================================================ */
:root {
  --bg:         #0a0a0a;
  --fg:         #d1d0c5;
  --accent:     #e2b714;
  --accent-dim: #c4a030;
  --muted:      #808388;
  --border:     #2c2e31;
  --surface:    #1a1a1a;
  --font-mono:  'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-sans:  'Fira Sans', system-ui, -apple-system, sans-serif;
  --font-serif: 'Rufina', Georgia, serif;
  --nav-height: 64px;
}

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

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* NOTE: visible focus ring for keyboard navigation — only shown on keyboard, not mouse */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================================
   Navbar
   ============================================================ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(44, 46, 49, 0.4);
  animation: slideDown 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.nav-logo-text {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  color: var(--fg);
}

.nav-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
  text-decoration: none;
}

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

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 101;
}

.nav-burger-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-burger.is-open .nav-burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-burger.is-open .nav-burger-line:nth-child(2) {
  opacity: 0;
}

.nav-burger.is-open .nav-burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Ghost search button override */
.gh-search-btn {
  color: var(--muted) !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0;
  transition: color 0.2s;
}

.gh-search-btn:hover {
  color: var(--accent) !important;
}

.gh-search-btn svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
   Animated backgrounds (grid + particles)
   ============================================================ */
.grid-bg,
.particles-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.grid-line {
  position: absolute;
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
  animation: gridPulse var(--duration, 3s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0.2;
}

.grid-line--v {
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
}

.grid-line--h {
  height: 1px;
  width: 100%;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: float var(--float-duration, 15s) linear infinite;
  animation-delay: var(--float-delay, 0s);
  opacity: 0;
}

/* ============================================================
   Hero section
   ============================================================ */
.hero-section {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 2rem;
  z-index: 10;
  overflow: visible;
  pointer-events: none;
  opacity: var(--parallax-opacity, 1);
  transform: scale(var(--parallax-scale, 1));
  transition: opacity 0.05s linear, transform 0.05s linear;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  position: relative;
  z-index: 10;
  animation: fadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: fadeIn 0.8s 0.2s both;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 8vw, 6rem);
  line-height: 0.9;
  margin-bottom: 2rem;
  text-align: left;
  position: relative;
  z-index: 100;
  pointer-events: auto;
  transform: translate(var(--mouse-x, 0px), var(--mouse-y, 0px));
  transition: transform 0.1s linear;
}

.hero-line {
  display: block;
  white-space: nowrap;
}

.hero-line--dim {
  font-weight: 300;
  color: var(--fg);
  opacity: 0;
  animation: fadeInLeft 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-line--dim:nth-child(1) { animation-delay: 0.3s; }
.hero-line--dim:nth-child(3) { animation-delay: 0.7s; }

.hero-line--accent {
  font-weight: 600;
  color: var(--fg);
  opacity: 0;
  animation: fadeInLeft 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}

.hero-tag-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.hero-prompt {
  color: var(--muted);
  margin-right: 0.2em;
  animation: promptPulse 2s ease-in-out infinite;
}

.hero-prompt--accent {
  color: var(--accent);
  animation: promptPulseAccent 1.5s ease-in-out infinite;
}

/* ============================================================
   Hero letter hover effects
   ============================================================ */
.letter-word {
  display: inline-block;
  white-space: nowrap;
}

.letter {
  display: inline-block;
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), color 0.15s ease;
}

.letter-group--lift-color .letter:hover {
  transform: translateY(-5px);
  color: var(--accent);
}

.letter-group--lift-scale .letter:hover {
  transform: translateY(-5px) scale(1.1);
}

.post-title .letter:hover,
.post-content h2 .letter:hover,
.post-content h3 .letter:hover {
  transform: translateY(-5px);
  color: var(--accent);
}

/* ============================================================
   Hero search terminal
   ============================================================ */
.hero-search-wrapper {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  cursor: text;
  position: relative;
  z-index: 9999;
  border-radius: 4px;
  transition: background 0.2s;
  /* Inherit font from .hero-title so it matches the other lines */
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  font-weight: 300;
  margin-top: 1rem;
  opacity: 0;
  animation: fadeInLeft 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.9s forwards;
}

.hero-search-wrapper:focus-within {
  background: rgba(226, 183, 20, 0.08);
}

.search-terminal {
  display: inline-flex;
  align-items: center;
  position: relative;
  max-width: 90vw;
  overflow: visible;
  line-height: 1;
}

@media (min-width: 769px) {
  .search-terminal {
    padding-bottom: 1.25rem;
    line-height: 1.4;
  }
}

/* Invisible mirror span — JS writes typed text here to measure width */
.search-text-mirror {
  visibility: hidden;
  white-space: pre;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: inherit;
  font-weight: 300;
  line-height: inherit;
  position: absolute;
  top: 0;
  left: 0;
  max-width: 44vw;
}

/* Cursor sits at position 0 and is translated by JS */
.search-cursor {
  color: var(--accent);
  pointer-events: none;
  font-weight: 300;
  animation: blink 1s step-end infinite;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.search-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  caret-color: transparent;
  font-family: var(--font-mono);
  font-size: inherit;
  line-height: inherit;
  font-weight: 300;
  padding: 0;
  margin: 0;
  position: relative;
  width: 100%;
  max-width: 44vw;
}

.search-input::placeholder {
  color: transparent;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 1rem;
  width: 100%;
  background: #111111;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  z-index: 9999;
}

.search-results[hidden] {
  display: none;
}

.search-result-item {
  display: block;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  cursor: pointer;
  text-decoration: none;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item.is-selected {
  background: rgba(226, 183, 20, 0.1);
}

.search-result-title {
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  white-space: normal;
  word-break: break-word;
}

.search-result-excerpt {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 1rem;
  white-space: normal;
  word-break: break-word;
}

.search-result-excerpt mark,
.search-result-title mark {
  background: none;
  color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   Hero tagline + scroll hint + profile
   ============================================================ */
.hero-tagline {
  color: var(--muted);
  max-width: 28rem;
  text-align: center;
  font-size: 1.125rem;
  letter-spacing: 0.03em;
  margin-top: 1rem;
  opacity: 0;
  animation: fadeIn 0.8s 1s both;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
  color: var(--accent);
  font-size: 1.4rem;
  cursor: pointer;
  pointer-events: auto;
  animation: bounce 1.6s ease-in-out infinite, fadeIn 0.8s 1.5s both;
  user-select: none;
}

/* ============================================================
   GBC widget (top-right hero)
   ============================================================ */
.gbc-widget {
  position: absolute;
  bottom: calc(2rem + 0.75rem);
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
}

.gbc-widget-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
  opacity: 0;
  animation: fadeIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.2s forwards;
}

.gbc-widget a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}

.gbc-label {
  font-size: 9px;
  color: #9060c0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 10px;
}

#gb-svg {
  display: block;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: gb-rock 3.2s ease-in-out infinite;
}

@keyframes gb-rock {
  0%, 100% { transform: rotate(27deg); }
  50%       { transform: rotate(39deg); }
}

.gbc-widget a:hover #gb-svg {
  animation: none;
  transform: rotate(33deg) scale(1.04);
  transition: transform 0.2s ease;
}

#gb-cursor {
  animation: gb-blink 1.1s step-end infinite;
}

@keyframes gb-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

#gb-led {
  animation: gb-led 2s ease-in-out infinite;
}

@keyframes gb-led {
  0%, 100% { fill: #cc30ff; }
  50%       { fill: #ee80ff; }
}

.hero-profile {
  position: absolute;
  bottom: 2rem;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-profile-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: flex-end;
}

.profile-img {
  width: 8rem;
  height: 8rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  object-fit: cover;
  pointer-events: auto;
  opacity: 0;
  animation: fadeInScale 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.2s forwards;
}

/* ============================================================
   Posts section
   ============================================================ */
.posts-section {
  position: relative;
  background: var(--bg);
  border-top: 1px solid var(--surface);
  padding: 6rem 2rem;
  z-index: 20;
}

.posts-inner {
  max-width: 1152px;
  margin: 0 auto;
}

.posts-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 4rem;
}

.posts-header-rule {
  height: 1px;
  width: 3rem;
  background: var(--muted);
}

.posts-header-label {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .post-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   Post card
   ============================================================ */
.post-card {
  border-left: 2px solid var(--border);
  border-radius: 0 8px 8px 0;
  transition: border-color 0.1s, background 0.1s;
}

.post-card-link {
  display: block;
  overflow-wrap: break-word;
  word-break: break-word;
  padding: 1rem 0 1rem 1.5rem;
  text-decoration: none;
}

/* Featured posts get an accent border and a ★ badge */
.featured.post-card {
  border-left-color: var(--accent);
  border-left-width: 3px;
}

.featured .post-card-title::before {
  content: '★ ';
  color: var(--accent);
  font-size: 0.8em;
}

.post-card:hover {
  border-color: var(--accent);
  background: rgba(226, 183, 20, 0.02);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.post-card-sep {
  color: var(--muted);
}

.post-card-title {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  color: var(--fg);
  transition: color 0.3s;
  line-height: 1.3;
}

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

.post-card-excerpt {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 0 1rem 1.5rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
}

.post-card-read-more {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--muted);
  transition: color 0.3s;
}

.post-card:hover .post-card-read-more {
  color: var(--accent);
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 4rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.pagination a {
  color: var(--muted);
  transition: color 0.2s;
}

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

/* ============================================================
   Post article
   ============================================================ */
.post-article {
  min-height: 100vh;
  background: #292c38;
}

.post-article-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 3rem;
  transition: color 0.2s;
  text-decoration: none;
}

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

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--muted);
}

.post-meta-sep {
  color: var(--muted);
}

.post-meta-authors {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.post-meta-author-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.post-meta-author-link:hover {
  color: var(--fg);
}

.post-meta-author-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.post-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.8rem;
  color: var(--accent);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid #888;
}

.post-tags .tag {
  color: var(--fg);
  background: var(--surface);
}

.post-feature-image {
  margin-bottom: 3rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.post-feature-caption {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  background: var(--surface);
}

.post-feature-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ============================================================
   Post content typography
   ============================================================ */
.post-content {
  color: var(--fg);
  line-height: 1.8;
  font-size: 1.125rem;
  overflow-wrap: break-word;
}

.post-content p {
  margin-bottom: 1.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.post-content p:hover {
  background: rgba(255, 255, 255, 0.04);
}


.post-content h1 {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
  line-height: 1.2;
}

.post-content h2 {
  font-family: var(--font-serif);
  font-size: 2.35rem;
  font-weight: 700;
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  color: #e2b714;
  line-height: 1.2;
}

.post-content h3 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: #e2b714;
  line-height: 1.2;
}

.post-content a {
  color: #3783ff;
  text-decoration: underline;
  transition: color 0.2s;
}

.post-content a:hover {
  color: #60a5fa;
}

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

.post-content em {
  font-style: italic;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: #000;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}

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

.post-content pre code {
  background: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--fg);
}

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}

.post-content hr {
  border: none;
  border-top: 2px solid #888;
  margin: 2rem 0;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

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

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

.post-footer-nav {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #888;
}

/* ============================================================
   Author social links
   ============================================================ */
.author-location {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.author-social {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.author-social-link {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-decoration: none;
  transition: opacity 0.2s;
}

.author-social-link:hover {
  opacity: 0.7;
}

/* ============================================================
   Post card access badge
   ============================================================ */
.post-card-access {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   Footer nav
   ============================================================ */
.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: var(--fg);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid #888;
  padding: 3rem 2rem;
}

.footer-inner {
  max-width: 1152px;
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.footer-inner a {
  color: var(--muted);
  transition: color 0.2s;
}

.footer-inner a:hover {
  color: var(--accent);
}

/* ============================================================
   Error page
   ============================================================ */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.error-inner {
  text-align: center;
}

.error-code {
  font-size: 6rem;
  font-weight: 300;
  font-family: var(--font-mono);
  color: var(--accent);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-message {
  color: var(--muted);
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

/* ============================================================
   Keyframe animations
   ============================================================ */
@keyframes slideDown {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.2); opacity: 0.6; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

@keyframes float {
  0%   { opacity: 0; transform: translate(0, 0); }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--float-tx, 50px), var(--float-ty, -100px)); }
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.1; }
  50%       { opacity: 0.3; }
}

@keyframes promptPulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

@keyframes promptPulseAccent {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}

/* ============================================================
   Post comments
   ============================================================ */
.post-comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #888;
}

.post-cta {
  margin-top: 3rem;
  padding: 2rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(226, 183, 20, 0.05);
  text-align: center;
}

.post-cta-title {
  color: var(--fg);
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

.post-cta-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.post-cta-btn {
  background: var(--accent);
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.post-cta-btn:hover {
  opacity: 0.85;
}

.post-cta-link {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: underline;
}

/* ============================================================
   Post navigation (prev/next)
   ============================================================ */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #888;
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.post-nav-prev,
.post-nav-next {
  max-width: 45%;
}

.post-nav-next {
  text-align: right;
  margin-left: auto;
}

.post-nav-link {
  color: var(--muted);
  transition: color 0.2s;
  text-decoration: none;
}

.post-nav-link:hover {
  color: var(--accent);
}

/* ============================================================
   Post excerpt (custom_excerpt)
   ============================================================ */
.post-excerpt {
  font-size: 1.25rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 2rem;
  font-style: italic;
}

/* ============================================================
   Author / tag archive header
   ============================================================ */
.author-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.author-avatar {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.author-meta {
  flex: 1;
}

.author-meta .posts-header {
  margin-bottom: 0.75rem;
}

.archive-description {
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.6;
}

.archive-empty {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  grid-column: 1 / -1;
}

/* ============================================================
   Ghost navigation helper output
   ============================================================ */
.nav-links .nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links .nav li a {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.2s;
  text-decoration: none;
}

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

/* ============================================================
   Koenig editor card styles (required by gscan)
   ============================================================ */

/* Wide / full width images */
.post-content .kg-width-wide {
  width: 85vw;
  max-width: 1200px;
  margin-left: calc(50% - 42.5vw);
}

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

/* Gallery */
.kg-gallery-container {
  display: flex;
  flex-direction: column;
  margin: 1.5rem 0;
}

.kg-gallery-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 4px;
}

.kg-gallery-image {
  flex: 1 1 auto;
  overflow: hidden;
}

.kg-gallery-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  border: none;
  margin: 0;
}

/* Bookmark card */
.kg-bookmark-card {
  margin: 1.5rem 0;
}

.kg-bookmark-container {
  display: flex;
  min-height: 148px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  background: var(--surface);
  transition: border-color 0.2s;
}

.kg-bookmark-container:hover {
  border-color: var(--accent);
}

.kg-bookmark-content {
  flex: 1;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.kg-bookmark-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.kg-bookmark-description {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.kg-bookmark-metadata {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.kg-bookmark-icon {
  width: 16px;
  height: 16px;
  object-fit: cover;
  flex-shrink: 0;
}

.kg-bookmark-author {
  color: var(--muted);
}

.kg-bookmark-publisher {
  color: var(--muted);
}

.kg-bookmark-thumbnail {
  width: 200px;
  flex-shrink: 0;
  overflow: hidden;
}

.kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  border: none;
  margin: 0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1230px) and (min-width: 769px) {
  .hero-title {
    font-size: clamp(1.75rem, 5vw, 4rem);
  }

  .hero-search-wrapper {
    font-size: clamp(1.75rem, 5vw, 4rem);
  }


  .search-text-mirror,
  .search-input {
    max-width: 52vw;
  }
}

@media (max-width: 768px) {
  .gbc-widget #gb-svg {
    width: 32px;
    height: 51px;
  }

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

  .nav-burger {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 1rem 1.5rem;
    z-index: 100;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links .nav-link,
  .nav-links .gh-search-btn {
    padding: 1.25rem 0;
    width: 100%;
    border-bottom: none;
    font-size: 1rem;
  }

  /* NOTE: Ghost {{navigation}} renders a <ul class="nav">, override the desktop flex-row */
  .nav-links .nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0;
    gap: 0;
  }

  .nav-links .nav li {
    width: 100%;
    border-bottom: none;
  }

  .nav-links .nav li a {
    display: block;
    padding: 1.25rem 0;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 1rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
  }

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

  .hero-title {
    font-size: clamp(1.25rem, 7vw, 2.5rem);
  }

  .hero-search-wrapper {
    font-size: clamp(1.25rem, 7vw, 2.5rem);
  }

  .search-results {
    min-width: 0;
    width: 85vw;
    left: 0;
    top: auto;
    bottom: calc(100% + 0.5rem);
    margin-top: 0;
  }

  .nav-inner {
    padding: 0 1rem;
  }

  .posts-section {
    padding: 4rem 1rem;
  }

  .hero-profile {
    display: flex;
  }

  .hero-profile .hero-profile-inner {
    width: 100%;
    justify-content: flex-end;
    padding: 0 1rem;
  }

  .hero-profile .profile-img {
    width: 4rem;
    height: 4rem;
  }

  .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .post-meta-sep {
    display: none;
  }

  .hero-search-wrapper {
    padding-top: 0.5rem;
    padding-bottom: 1rem;
  }

  .search-text-mirror,
  .search-input {
    max-width: 74vw;
  }
}
