/* ============================================
   BRUTALIST-DEV GHOST THEME
   Bold. Raw. Developer-first.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:ital,wght@0,400;0,700;1,400&family=Bebas+Neue&family=IBM+Plex+Sans:wght@300;400;500;600&display=swap');

/* ============================================
   CSS CUSTOM PROPERTIES — LIGHT MODE (default)
   ============================================ */
:root {
  --bg:          #F5F0E8;
  --bg-secondary:#EDE8DC;
  --fg:          #0A0A0A;
  --fg-muted:    #3A3A3A;
  --accent:      #FF3B00;
  --accent-2:    #0038FF;
  --border:      #0A0A0A;
  --border-width: 2px;
  --card-bg:     #FFFFFF;
  --tag-bg:      #0A0A0A;
  --tag-fg:      #F5F0E8;
  --code-bg:     #1A1A1A;
  --code-fg:     #00FF88;
  --shadow:      4px 4px 0px #0A0A0A;
  --shadow-lg:   8px 8px 0px #0A0A0A;
  --font-display:'Bebas Neue', sans-serif;
  --font-mono:   'Space Mono', monospace;
  --font-body:   'IBM Plex Sans', sans-serif;
  --transition:  150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
  --bg:          #0A0A0A;
  --bg-secondary:#141414;
  --fg:          #F0EBE0;
  --fg-muted:    #888880;
  --accent:      #FF3B00;
  --accent-2:    #4D7CFF;
  --border:      #F0EBE0;
  --card-bg:     #141414;
  --tag-bg:      #F0EBE0;
  --tag-fg:      #0A0A0A;
  --code-bg:     #0D0D0D;
  --code-fg:     #00FF88;
  --shadow:      4px 4px 0px #F0EBE0;
  --shadow-lg:   8px 8px 0px #F0EBE0;
}

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

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

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

::selection {
  background: var(--accent);
  color: #fff;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.05;
  color: var(--fg);
}

h1 { font-size: clamp(3rem, 8vw, 7rem); }
h2 { font-size: clamp(2rem, 5vw, 4rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.5rem); }

p { font-family: var(--font-body); line-height: 1.75; }

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================
   HEADER / NAV
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: var(--border-width) solid var(--border);
  padding: 0;
}

.nav-inner {
  display: flex;
  align-items: stretch;
  height: 56px;
  gap: 0;
}

.site-logo {
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-right: var(--border-width) solid var(--border);
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  color: var(--fg);
  text-decoration: none;
  transition: background var(--transition);
  white-space: nowrap;
}

.site-logo:hover {
  background: var(--accent);
  color: #fff;
}

.site-logo img {
  height: 28px;
  width: auto;
}

.nav-menu {
  display: flex;
  list-style: none;
  align-items: stretch;
  flex: 1;
  gap: 0;
  margin: 0;
  padding: 0;
}

.nav-menu li { display: flex; align-items: stretch; }

.nav-menu a {
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg);
  border-right: var(--border-width) solid var(--border);
  transition: background var(--transition), color var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
  background: var(--fg);
  color: var(--bg);
}

.nav-actions {
  display: flex;
  align-items: stretch;
  margin-left: auto;
  gap: 0;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem;
  border: none;
  border-left: var(--border-width) solid var(--border);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font-size: 1.1rem;
  transition: background var(--transition), color var(--transition);
}

.theme-toggle:hover {
  background: var(--fg);
  color: var(--bg);
}

.nav-cta {
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-left: var(--border-width) solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  transition: background var(--transition);
}

.nav-cta:hover { background: var(--accent-2); color: #fff; }

/* Mobile nav toggle */
.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem;
  border: none;
  border-left: var(--border-width) solid var(--border);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  font-size: 1.25rem;
}

/* ============================================
   HERO SECTION (index page)
   ============================================ */
.hero {
  border-bottom: var(--border-width) solid var(--border);
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: var(--accent);
  opacity: 0.04;
  border-radius: 50%;
  pointer-events: none;
}

.hero-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hero-label::before {
  content: '';
  display: inline-block;
  width: 2rem;
  height: 2px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 10rem);
  line-height: 0.92;
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
  max-width: 900px;
}

.hero-title span {
  color: var(--accent);
  display: block;
}

.hero-description {
  font-family: var(--font-body);
  font-size: 1.125rem;
  color: var(--fg-muted);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: var(--border-width) solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

.btn-outline {
  background: transparent;
  color: var(--fg);
  box-shadow: var(--shadow);
}

.btn-outline:hover {
  background: var(--fg);
  color: var(--bg);
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   POST GRID
   ============================================ */
.posts-section {
  padding: 4rem 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: var(--border-width) solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 2.5rem;
}

.section-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-muted);
}

.section-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
.section-link:hover { color: var(--accent-2); }

/* Featured post */
.post-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: var(--border-width) solid var(--border);
  box-shadow: var(--shadow-lg);
  margin-bottom: 2px;
  background: var(--card-bg);
  transition: transform var(--transition), box-shadow var(--transition);
}

.post-featured:hover {
  transform: translate(-3px, -3px);
  box-shadow: 10px 10px 0px var(--border);
}

.post-featured-image {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-right: var(--border-width) solid var(--border);
}

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

.post-featured:hover .post-featured-image img {
  transform: scale(1.03);
}

.post-featured-image.no-image {
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 6rem;
  color: var(--border);
  opacity: 0.15;
}

.post-featured-content {
  display: flex;
  flex-direction: column;
  padding: 2.5rem;
  justify-content: space-between;
}

/* Post grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-left: var(--border-width) solid var(--border);
  border-top: var(--border-width) solid var(--border);
}

.post-card {
  border-right: var(--border-width) solid var(--border);
  border-bottom: var(--border-width) solid var(--border);
  padding: 1.75rem;
  background: var(--card-bg);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.post-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.post-card:hover {
  background: var(--bg-secondary);
}

.post-card:hover::after {
  width: 100%;
}

/* Post meta / tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.post-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--tag-bg);
  color: var(--tag-fg);
  border: var(--border-width) solid var(--border);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.post-tag:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.post-tag.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.post-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.5vw, 2rem);
  line-height: 1.05;
  color: var(--fg);
  text-decoration: none;
  display: block;
  transition: color var(--transition);
}

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

.post-title--sm {
  font-size: clamp(1rem, 1.8vw, 1.4rem);
}

.post-excerpt {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--bg-secondary);
}

.post-meta-sep { opacity: 0.4; }

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

/* ============================================
   SINGLE POST PAGE
   ============================================ */
.post-header {
  border-bottom: var(--border-width) solid var(--border);
  padding: 4rem 0 0;
}

.post-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.post-header-tags {
  margin-bottom: 1.5rem;
}

.post-headline {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 6rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  margin-bottom: 1.5rem;
}

.post-subhead {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 640px;
  margin-bottom: 2rem;
}

.post-byline {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-top: var(--border-width) solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}

.post-byline-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

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

.post-byline-author strong {
  color: var(--fg);
  font-weight: 700;
}

.post-byline-sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--fg-muted);
}

/* Featured image */
.post-image {
  width: 100%;
  max-height: 600px;
  overflow: hidden;
  border-bottom: var(--border-width) solid var(--border);
}

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

/* ============================================
   POST CONTENT (article body)
   ============================================ */
.post-content {
  padding: 3rem 0 4rem;
}

.post-content .kg-content {
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--fg);
}

.post-content h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  margin: 2.5rem 0 1rem;
  padding-top: 2rem;
  border-top: var(--border-width) solid var(--border);
}

.post-content h3 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  margin: 2rem 0 0.75rem;
}

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

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

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

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

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

.post-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--bg-secondary);
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.95rem;
}

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

.post-content pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 1.5rem;
  overflow-x: auto;
  border: var(--border-width) solid var(--border);
  box-shadow: var(--shadow);
  margin: 2rem 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.post-content code {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 0.15em 0.4em;
  border-radius: 0;
  font-size: 0.875em;
}

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

.post-content img {
  border: var(--border-width) solid var(--border);
  box-shadow: var(--shadow);
  margin: 2rem 0;
}

.post-content hr {
  border: none;
  border-top: var(--border-width) solid var(--border);
  margin: 3rem 0;
}

/* Ghost cards */
.kg-width-wide {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

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

.kg-image-card { margin: 2rem 0; }
.kg-image-card figcaption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-align: center;
  margin-top: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kg-callout-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: var(--border-width) solid var(--border);
  background: var(--bg-secondary);
  margin: 2rem 0;
  box-shadow: var(--shadow);
}

.kg-bookmark-card {
  border: var(--border-width) solid var(--border);
  margin: 2rem 0;
  box-shadow: var(--shadow);
}

.kg-bookmark-container {
  display: flex;
  padding: 1.25rem;
  gap: 1.5rem;
  align-items: center;
  background: var(--card-bg);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition);
}

.kg-bookmark-container:hover { background: var(--bg-secondary); }

.kg-bookmark-content { flex: 1; }
.kg-bookmark-title {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 0.25rem;
}
.kg-bookmark-description {
  font-size: 0.8rem;
  color: var(--fg-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kg-bookmark-metadata {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--fg-muted);
  text-transform: uppercase;
}
.kg-bookmark-thumbnail {
  width: 120px;
  height: 80px;
  object-fit: cover;
  flex-shrink: 0;
  border-left: var(--border-width) solid var(--border);
}

/* ============================================
   POST FOOTER
   ============================================ */
.post-footer {
  border-top: var(--border-width) solid var(--border);
  padding: 3rem 0;
}

.author-box {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  border: var(--border-width) solid var(--border);
  box-shadow: var(--shadow);
  background: var(--card-bg);
  margin-bottom: 3rem;
}

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

.author-box-name {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.author-box-bio {
  font-size: 0.9rem;
  color: var(--fg-muted);
  line-height: 1.6;
}

/* Related posts */
.related-posts { padding-bottom: 4rem; }

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-left: var(--border-width) solid var(--border);
  border-top: var(--border-width) solid var(--border);
}

/* ============================================
   SIDEBAR (optional)
   ============================================ */
.with-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
  align-items: start;
  border-top: var(--border-width) solid var(--border);
}

.sidebar {
  border-left: var(--border-width) solid var(--border);
  position: sticky;
  top: 57px;
  padding: 2rem 1.5rem;
}

.sidebar-widget {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: var(--border-width) solid var(--border);
}

.sidebar-widget:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.sidebar-widget-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-widget-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  align-items: stretch;
  border: var(--border-width) solid var(--border);
  box-shadow: var(--shadow);
  margin-top: 3rem;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-right: var(--border-width) solid var(--border);
  transition: background var(--transition), color var(--transition);
}

.pagination a:hover {
  background: var(--fg);
  color: var(--bg);
}

.pagination-info {
  flex: 1;
  justify-content: center;
  color: var(--fg-muted);
}

.pagination a:last-child,
.pagination span:last-child { border-right: none; }

/* ============================================
   SUBSCRIBE / MEMBERSHIP
   ============================================ */
.subscribe-section {
  border-top: var(--border-width) solid var(--border);
  border-bottom: var(--border-width) solid var(--border);
  padding: 4rem 0;
  background: var(--fg);
  color: var(--bg);
  position: relative;
  overflow: hidden;
}

.subscribe-section::before {
  content: 'SUBSCRIBE';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(6rem, 20vw, 18rem);
  opacity: 0.04;
  white-space: nowrap;
  pointer-events: none;
  color: var(--bg);
}

.subscribe-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.subscribe-inner h2 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  color: var(--bg);
  margin-bottom: 1rem;
}

.subscribe-inner p {
  color: rgba(255,255,255,0.6);
  margin-bottom: 2rem;
  font-size: 1rem;
}

[data-theme="dark"] .subscribe-inner p { color: rgba(0,0,0,0.6); }

.subscribe-form {
  display: flex;
  gap: 0;
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .subscribe-form {
  border-color: rgba(0,0,0,0.3);
  box-shadow: 4px 4px 0px rgba(0,0,0,0.5);
}

.subscribe-form input {
  flex: 1;
  padding: 1rem 1.25rem;
  background: transparent;
  border: none;
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  border-right: 2px solid rgba(255,255,255,0.3);
}

[data-theme="dark"] .subscribe-form input { color: var(--fg); }

.subscribe-form input::placeholder { color: rgba(255,255,255,0.4); opacity: 1; }
[data-theme="dark"] .subscribe-form input::placeholder { color: rgba(0,0,0,0.4); }

.subscribe-form button {
  padding: 1rem 1.5rem;
  background: var(--accent);
  border: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}

.subscribe-form button:hover { background: var(--accent-2); }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  border-top: var(--border-width) solid var(--border);
  background: var(--bg-secondary);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 1.5rem;
  gap: 2rem;
  border-bottom: var(--border-width) solid var(--border);
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  color: var(--fg);
}

.footer-nav {
  display: flex;
  gap: 0;
  list-style: none;
}

.footer-nav a {
  display: block;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  border-left: var(--border-width) solid var(--border);
  transition: color var(--transition), background var(--transition);
}

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

.footer-bottom {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ============================================
   TAG / AUTHOR ARCHIVE PAGE
   ============================================ */
.archive-header {
  padding: 3rem 0;
  border-bottom: var(--border-width) solid var(--border);
}

.archive-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
}

.archive-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: 0.95;
  margin-bottom: 1rem;
}

.archive-description {
  color: var(--fg-muted);
  max-width: 540px;
  font-size: 1rem;
}

.archive-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 1rem;
}

/* ============================================
   ERROR (404) PAGE
   ============================================ */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(8rem, 25vw, 20rem);
  line-height: 1;
  color: var(--border);
  opacity: 0.15;
  margin-bottom: -2rem;
}

.error-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4rem);
  position: relative;
  z-index: 1;
}

.error-description {
  color: var(--fg-muted);
  max-width: 420px;
  margin: 1rem auto 2rem;
}

/* ============================================
   READING PROGRESS BAR
   ============================================ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ============================================
   TABLE OF CONTENTS
   ============================================ */
.toc {
  border: var(--border-width) solid var(--border);
  padding: 1.25rem;
  margin-bottom: 2rem;
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  margin-bottom: 1rem;
}

.toc-list {
  list-style: none;
  padding: 0;
}

.toc-list li {
  border-bottom: 1px solid var(--bg-secondary);
  padding: 0.4rem 0;
}

.toc-list li:last-child { border-bottom: none; }

.toc-list a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-list a::before {
  content: '//';
  color: var(--accent);
  font-size: 0.65rem;
}

.toc-list a:hover { color: var(--fg); }

/* ============================================
   SYNTAX HIGHLIGHT OVERRIDES
   ============================================ */
.hljs { background: var(--code-bg) !important; color: var(--code-fg) !important; }
.hljs-keyword { color: #ff79c6; }
.hljs-string  { color: #f1fa8c; }
.hljs-comment { color: #6272a4; font-style: italic; }
.hljs-number  { color: #bd93f9; }
.hljs-function{ color: #50fa7b; }
.hljs-built_in{ color: #8be9fd; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .with-sidebar { grid-template-columns: 1fr; }
  .sidebar {
    border-left: none;
    border-top: var(--border-width) solid var(--border);
    position: static;
  }
}

@media (max-width: 768px) {
  .post-featured { grid-template-columns: 1fr; }
  .post-featured-image { border-right: none; border-bottom: var(--border-width) solid var(--border); }
  .post-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .nav-menu { display: none; }
  .nav-hamburger { display: flex; }
  .nav-menu.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    border-top: var(--border-width) solid var(--border);
    z-index: 200;
    overflow-y: auto;
    align-items: stretch;
  }
  .nav-menu.open li { border-bottom: var(--border-width) solid var(--border); }
  .nav-menu.open a {
    padding: 1.25rem 1.5rem;
    font-size: 0.9rem;
    border-right: none;
  }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav { flex-wrap: wrap; }
  .author-box { flex-direction: column; }
  .subscribe-form { flex-direction: column; }
  .subscribe-form input { border-right: none; border-bottom: 2px solid rgba(255,255,255,0.3); }
}

@media (max-width: 480px) {
  .hero-title { font-size: clamp(3rem, 15vw, 5rem); }
  .pagination { flex-wrap: wrap; }
  .pagination a, .pagination span { border-bottom: var(--border-width) solid var(--border); }
}

/* ============================================
   PRINT
   ============================================ */
@media print {
  .site-header, .site-footer, .subscribe-section, .sidebar { display: none; }
  .post-content { padding: 0; }
  body { color: #000; background: #fff; }
}
