/*
Theme Name: Stackbyte
Theme URI: https://stackbyte.me
Author: Stackbyte
Author URI: https://stackbyte.me
Description: A clean, minimal dark/light theme for stackbyte.me — blog, tools showcase, and newsletter.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: stackbyte
*/

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ============================================================
   CSS VARIABLES — LIGHT MODE (default)
   Applied to html element so data-theme works on every page
   ============================================================ */
html,
:root {
  --bg: #f5f4ff;
  --bg2: #ffffff;
  --bg3: #eeecff;
  --border: rgba(90, 50, 220, 0.15);
  --text: #1a1a1a;
  --muted: #7766aa;
  --accent: #3f51b5;
  --accent2: #00b894;
  --accent3: #ff6b35;
  --tag-bg: rgba(79, 40, 245, 0.10);
  --card-shadow: 0 4px 20px rgba(79, 40, 245, 0.12);
  --card-hover: 0 10px 32px rgba(79, 40, 245, 0.20);

  /* Tag color palette - will be overridden by data-tag-color attribute */
  --tag-0-bg: rgba(79, 40, 245, 0.15);
  --tag-0-text: #4f28f5;
  --tag-1-bg: rgba(0, 184, 148, 0.15);
  --tag-1-text: #008856;
  --tag-2-bg: rgba(255, 107, 53, 0.15);
  --tag-2-text: #d94c1c;
  --tag-3-bg: rgba(70, 219, 247, 0.15);
  --tag-3-text: #0891b2;
  --tag-4-bg: rgba(255, 169, 51, 0.15);
  --tag-4-text: #c67c1a;
  --tag-5-bg: rgba(168, 85, 247, 0.15);
  --tag-5-text: #8b5cf6;
  --tag-6-bg: rgba(236, 72, 153, 0.15);
  --tag-6-text: #be185d;
  --tag-7-bg: rgba(34, 197, 94, 0.15);
  --tag-7-text: #16a34a;
}

/* ============================================================
   DARK MODE — toggled via [data-theme="dark"] on <html>
   ============================================================ */
html[data-theme="dark"] {
  --bg: #09080f;
  --bg2: #1a1830;
  --bg3: #242033;
  --border: rgba(130, 100, 255, 0.25);
  --text: #f0eeff;
  --muted: #b3a3d9;
  --accent: #7c5cff;
  --accent2: #00e0a0;
  --accent3: #ff7e45;
  --tag-bg: rgba(124, 92, 255, 0.15);
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.50);
  --card-hover: 0 10px 32px rgba(124, 92, 255, 0.30);

  /* Tag color palette - will be overridden by data-tag-color attribute */
  --tag-0-bg: rgba(124, 92, 255, 0.20);
  --tag-0-text: #a399ff;
  --tag-1-bg: rgba(0, 224, 160, 0.20);
  --tag-1-text: #4fffd9;
  --tag-2-bg: rgba(255, 123, 69, 0.20);
  --tag-2-text: #ff9d7e;
  --tag-3-bg: rgba(70, 219, 247, 0.20);
  --tag-3-text: #7efefd;
  --tag-4-bg: rgba(255, 169, 51, 0.20);
  --tag-4-text: #ffc485;
  --tag-5-bg: rgba(168, 85, 247, 0.20);
  --tag-5-text: #d9a3ff;
  --tag-6-bg: rgba(236, 72, 153, 0.20);
  --tag-6-text: #ff8db8;
  --tag-7-bg: rgba(34, 197, 94, 0.20);
  --tag-7-text: #86efac;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

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

/* ============================================================
   LAYOUT
   ============================================================ */
.site-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 48px;
  width: 100%;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  transition: background 0.3s;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.5px;
  text-decoration: none;
}

.nav-logo span {
  color: var(--accent2);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
  text-decoration: none;
}

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

/* Theme toggle */
.theme-toggle {
  width: 44px;
  height: 24px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.3s;
  padding: 0;
  margin: 0;
  display: block;
  z-index: 10;
  pointer-events: auto;
}

.theme-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform 0.3s, background 0.3s;
}

[data-theme="dark"] .theme-toggle-knob {
  transform: translateX(20px);
  background: var(--accent2);
}

/* Mobile nav toggle */
.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 22px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  padding: 11px 26px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(79, 40, 245, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79, 40, 245, 0.45);
}

.btn-ghost {
  display: inline-block;
  background: transparent;
  color: var(--accent) !important;
  padding: 11px 26px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 2px solid var(--accent);
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.2s, color 0.2s;
}

.btn-ghost:hover {
  background: var(--accent);
  color: #fff !important;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding: 90px 0 72px;
  max-width: 680px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--tag-bg);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 28px;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.hero-tag::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--accent2);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.hero h1 {
  font-size: 52px;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -2px;
  margin-bottom: 20px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
  position: relative;
}

.hero h1 em::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px;
}

.hero p {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.85;
  margin-bottom: 36px;
}

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

/* ============================================================
   SECTION HEADERS
   ============================================================ */
.section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent2);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 500;
}

.section-title {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -1px;
  margin-bottom: 6px;
}

.section-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 36px;
}

/* ============================================================
   BLOG CARDS (index + archive)
   ============================================================ */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.blog-card {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: block;
  text-decoration: none !important;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--card-shadow);
  color: var(--text);
}

.blog-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--card-hover);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.blog-tag {
  background: var(--tag-bg);
  color: var(--accent);
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid;
  border-color: currentColor;
  font-weight: 500;
  opacity: 0.9;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

/* Tags with data attributes get their colors from JavaScript/data */
.blog-tag[data-light-bg] {
  opacity: 1;
}

.blog-date {
  color: var(--muted);
  font-size: 11px;
}

.blog-card h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
  line-height: 1.4;
  color: var(--text);
}

.blog-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

.blog-card-footer {
  margin-top: 18px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

/* ============================================================
   SINGLE POST
   ============================================================ */
.post-layout {
  display: grid;
  grid-template-columns: 52px 1fr 260px;
  gap: 40px;
  align-items: start;
}

.post-sidebar {
  position: sticky;
  top: 88px;
  padding-top: 64px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  padding-bottom: 24px;
}

.sidebar-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--accent2);
  letter-spacing: 2px;
  font-weight: 500;
  margin-bottom: 14px;
}

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-header {
  padding: 64px 0 40px;
  max-width: 740px;
}

.post-header .blog-card-meta {
  margin-bottom: 20px;
}

.post-title {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin-bottom: 16px;
}

.post-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 32px;
}

.post-featured-image {
  width: 100%;
  border-radius: 14px;
  margin-bottom: 48px;
  border: 1px solid var(--border);
}

.post-content {
  max-width: 680px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  padding-bottom: 64px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.post-content h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.6px;
  margin: 40px 0 16px;
  color: var(--text);
}

.post-content h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--text);
}

.post-content p {
  margin-bottom: 20px;
}

.post-content ul,
.post-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
}

.post-content li {
  margin-bottom: 6px;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 28px 0;
  background: var(--bg3);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  font-style: italic;
}

.post-content pre {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  margin-bottom: 20px;
}

.post-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}

.post-content pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
}

.post-content img {
  border-radius: 10px;
  margin: 24px 0;
}

/* Post navigation */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 64px;
}

.post-nav a {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  flex: 1;
  transition: border-color 0.2s;
}

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

.post-nav .nav-prev {
  text-align: left;
}

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

.post-nav span {
  display: block;
  font-size: 11px;
  color: var(--accent2);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 4px;
  letter-spacing: 1px;
}

/* ============================================================
   TOOLS SECTION
   ============================================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  height: 100%;
}

.tool-card:hover {
  border-color: var(--accent2);
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(0, 184, 148, 0.18);
}

.tool-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(79, 40, 245, 0.25);
}

.tool-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.tool-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 16px;
  flex-grow: 1;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.tool-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent2);
  letter-spacing: 0.8px;
  font-weight: 500;
}

.tool-status.live::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent2);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.tool-github {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.tool-github:hover {
  color: var(--accent);
}

/* ============================================================
   NEWSLETTER BOX
   ============================================================ */
.newsletter-box {
  background: linear-gradient(135deg, var(--bg2) 60%, var(--bg3));
  border: 1.5px solid var(--accent);
  border-radius: 16px;
  padding: 48px;
  max-width: 580px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--card-hover);
}

.newsletter-box::after {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.12;
  pointer-events: none;
}

.newsletter-box h3 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.6px;
  margin-bottom: 8px;
}

.newsletter-box p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.email-row {
  display: flex;
  gap: 10px;
}

.email-input {
  flex: 1;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 11px 16px;
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.email-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 40, 245, 0.12);
}

.email-input::placeholder {
  color: var(--muted);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copy {
  font-size: 12px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.footer-links a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(0.75);
  }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  .hero h1 {
    font-size: 36px;
    letter-spacing: -1px;
  }

  .post-title {
    font-size: 28px;
  }

  .nav-links {
    display: none;
  }

  .nav-mobile-toggle {
    display: block;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 20px;
    gap: 16px;
  }

  .email-row {
    flex-direction: column;
  }

  .newsletter-box {
    padding: 28px;
  }

  .post-nav {
    flex-direction: column;
  }

  .blog-grid,
  .tools-grid {
    grid-template-columns: 1fr;
  }

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

  article {
    order: 1;
  }

  .post-sidebar {
    position: static;
    padding-top: 0;
    padding-bottom: 32px;
    order: 3;
    max-height: none;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  /* ── Post tags (top 2 tags on mobile) ── */
  .post-tags {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
  }

  /* ── Floating action buttons on mobile ── */
  .post-actions {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    left: auto !important;
    top: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 50 !important;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: auto;
    order: auto !important;
  }

  .post-actions.hidden {
    opacity: 0;
    pointer-events: none;
  }

  .action-btn {
    width: auto;
    height: auto;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    outline: none;
    cursor: pointer;
    font-size: 44px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .action-btn:focus {
    outline: none;
  }

  .action-icon {
    font-size: 44px !important;
  }

  .action-count {
    display: none !important;
  }
}

/* ── Hide post-tags on desktop ── */
@media (min-width: 769px) {
  .post-tags {
    display: none;
  }
}

/* ============================================================
   BLOG SEARCH (Pagefind)
   ============================================================ */
.blog-search-wrap {
  max-width: 560px;
  margin: 0 auto 48px;
}

/* Override Pagefind defaults to match site theme */
.pagefind-ui__search-input {
  background: var(--bg2) !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 10px !important;
  color: var(--text) !important;
  font-family: 'Sora', sans-serif !important;
  font-size: 14px !important;
  padding: 12px 16px !important;
  box-shadow: none !important;
}

.pagefind-ui__search-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(79, 40, 245, 0.12) !important;
  outline: none !important;
}

.pagefind-ui__search-clear,
.pagefind-ui__search-input::placeholder {
  color: var(--muted) !important;
}

.pagefind-ui__result {
  border-bottom: 1px solid var(--border) !important;
  padding: 16px 0 !important;
}

.pagefind-ui__result-title a {
  color: var(--accent) !important;
  font-weight: 600 !important;
  font-size: 15px !important;
}

.pagefind-ui__result-excerpt {
  color: var(--muted) !important;
  font-size: 13px !important;
}

.pagefind-ui__button {
  background: var(--accent) !important;
  color: #fff !important;
  border-radius: 8px !important;
  border: none !important;
  font-family: 'Sora', sans-serif !important;
}

/* ============================================================
   POST ACTIONS — left sticky sidebar (views, claps, comments)
   ============================================================ */
.post-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 120px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 8px;
  width: 48px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  color: var(--text);
  font-family: inherit;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.action-icon {
  font-size: 20px;
  line-height: 1;
}

.action-count {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  line-height: 1;
}

/* Clap — amber */
#clap-btn {
  border-color: rgba(255, 107, 53, 0.35);
}

#clap-btn .action-count {
  color: var(--accent3);
}

#clap-btn:hover {
  border-color: var(--accent3);
}

#clap-btn.clapped {
  background: rgba(255, 107, 53, 0.10);
  border-color: var(--accent3);
}

#clap-btn.clapped .action-icon {
  filter: saturate(2);
}

/* Comments — teal */
#comments-link {
  border-color: rgba(0, 184, 148, 0.35);
}

#comments-link .action-count {
  color: var(--accent2);
}

#comments-link:hover {
  border-color: var(--accent2);
}

/* Views — purple/accent */
#views-group {
  border-color: rgba(63, 81, 181, 0.35);
  cursor: default;
}

#views-group .action-count {
  color: var(--accent);
}

/* ============================================================
   COMMENTS SECTION
   ============================================================ */
.comments-section {
  max-width: 680px;
  padding-bottom: 64px;
}

.comments-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin-bottom: 28px;
  color: var(--text);
}

.comment-card {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.comment-author {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.comment-date {
  font-size: 11px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

.comment-body {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
}

.comment-form {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comment-form h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.form-input,
.form-textarea {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 40, 245, 0.10);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--muted);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.form-note.success {
  color: var(--accent2);
}

.form-note.error {
  color: var(--accent3);
}

.comments-empty {
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
  padding: 16px 0;
}

/* ============================================================
   SIDEBAR ADDITIONS — newsletter + mini contact form
   ============================================================ */
.sidebar-section {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

.sidebar-muted {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 6px 0 12px;
}

.sidebar-email-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-email-input,
.sidebar-input,
.sidebar-textarea {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 8px 12px;
  color: var(--text);
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}

.sidebar-email-input:focus,
.sidebar-input:focus,
.sidebar-textarea:focus {
  border-color: var(--accent);
}

.sidebar-email-input::placeholder,
.sidebar-input::placeholder,
.sidebar-textarea::placeholder {
  color: var(--muted);
}

.sidebar-textarea {
  resize: vertical;
  min-height: 72px;
}

.sidebar-contact-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-sm {
  padding: 8px 14px !important;
  font-size: 12px !important;
  width: 100%;
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 64px 0 80px;
}

.contact-page .section-label {
  margin-bottom: 8px;
}

.contact-page .section-title {
  margin-bottom: 24px;
}

.contact-form {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 32px;
}

/* ============================================================
   ADMIN PAGES
   ============================================================ */
.admin-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 0 80px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.admin-header h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.admin-nav {
  display: flex;
  gap: 12px;
}

.admin-nav a {
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  transition: color 0.2s, border-color 0.2s;
}

.admin-nav a:hover,
.admin-nav a.active {
  color: var(--accent);
  border-color: var(--accent);
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.admin-stat-card {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.admin-stat-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
}

.admin-stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}

.admin-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: var(--bg3);
}

.admin-badge {
  display: inline-block;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.admin-badge.pending {
  background: rgba(255, 169, 51, 0.15);
  color: #c67c1a;
}

.admin-badge.approved {
  background: rgba(0, 184, 148, 0.15);
  color: var(--accent2);
}

.admin-badge.unread {
  background: rgba(79, 40, 245, 0.12);
  color: var(--accent);
}

.admin-badge.read {
  background: var(--bg3);
  color: var(--muted);
}

html[data-theme="dark"] .admin-badge.pending {
  color: #ffc485;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-btn {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

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

.admin-btn.approve:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

.admin-btn.reject:hover,
.admin-btn.delete:hover {
  border-color: var(--accent3);
  color: var(--accent3);
}

.admin-reply-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-reply-form textarea {
  width: 100%;
  font-family: 'Sora', sans-serif;
  font-size: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  resize: vertical;
  min-height: 60px;
  outline: none;
}

.admin-section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.admin-empty {
  text-align: center;
  padding: 48px 0;
  color: var(--muted);
  font-size: 14px;
}