/* ==========================================================================
   BIRENK — Main Stylesheet
   Fonts: Roboto, Roboto Mono (Google Fonts)
   Layout: Top-bar sticky nav, card-based content
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* Colour Palette — Dark mode default */
  --bg-primary:       #0f1117;
  --bg-secondary:     #161b27;
  --bg-card:          #1c2333;
  --bg-card-hover:    #212840;
  --bg-header:        rgba(15, 17, 23, 0.92);

  --text-primary:     #e6edf3;
  --text-secondary:   #8b949e;
  --text-muted:       #484f58;
  --text-on-accent:   #ffffff;

  --accent:           #58a6ff;
  --accent-hover:     #79b8ff;
  --accent-dim:       rgba(88, 166, 255, 0.12);
  --accent-glow:      rgba(88, 166, 255, 0.25);

  --green:            #3fb950;
  --orange:           #d29922;
  --red:              #f85149;
  --purple:           #bc8cff;

  --border:           rgba(255, 255, 255, 0.08);
  --border-accent:    rgba(88, 166, 255, 0.35);

  --shadow-sm:        0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:        0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:        0 8px 32px rgba(0,0,0,0.6);

  --radius-sm:        6px;
  --radius-md:        10px;
  --radius-lg:        16px;

  --header-height:    64px;
  --max-width:        1200px;
  --content-width:    760px;

  --font-sans:        'Roboto', system-ui, sans-serif;
  --font-mono:        'Roboto Mono', 'Courier New', monospace;

  --transition:       0.2s ease;
}

/* Light mode overrides */
[data-theme="light"] {
  --bg-primary:       #ffffff;
  --bg-secondary:     #f6f8fa;
  --bg-card:          #ffffff;
  --bg-card-hover:    #f0f4f8;
  --bg-header:        rgba(255, 255, 255, 0.95);

  --text-primary:     #1c2128;
  --text-secondary:   #57606a;
  --text-muted:       #8c959f;

  --accent:           #0969da;
  --accent-hover:     #1a7f37;
  --accent-dim:       rgba(9, 105, 218, 0.08);
  --accent-glow:      rgba(9, 105, 218, 0.15);

  --border:           rgba(0, 0, 0, 0.1);
  --border-accent:    rgba(9, 105, 218, 0.3);
}

/* --------------------------------------------------------------------------
   2. Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

ul, ol { list-style: none; }

button {
  cursor: pointer;
  font-family: var(--font-sans);
  border: none;
  background: none;
}

/* --------------------------------------------------------------------------
   3. Layout Utilities
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 24px;
}

.content-container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: 24px;
}

/* --------------------------------------------------------------------------
   4. Site Header / Navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition), border-color var(--transition);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 24px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand:hover { color: var(--text-primary); }
.brand:focus-visible { color: var(--accent); }

.brand-icon {
  display: inline-block;
  font-size: 18px;
  color: var(--accent);
  line-height: 1;
  transform: rotate(45deg);
  transition: transform 0.4s ease;
}
.brand:hover .brand-icon { transform: rotate(225deg); }

.brand-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}

.brand-dot { color: var(--accent); }

/* Primary Nav */
.primary-nav {
  flex: 1;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--accent-dim);
}

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

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: 1rem;
  border: 1px solid var(--border);
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--accent-dim);
  border-color: var(--border-accent);
}

/* Hamburger Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 6px;
  color: var(--text-secondary);
  transition: background var(--transition), border-color var(--transition);
}

.nav-toggle:hover {
  background: var(--accent-dim);
  border-color: var(--border-accent);
}

.hamburger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   5. Site Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  margin-top: 80px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-block: 56px;
}

.footer-brand .brand-icon {
  font-size: 16px;
  transform: rotate(45deg);
}

.footer-brand .brand-name {
  font-size: 1.2rem;
  color: var(--text-primary);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand > :first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 280px;
}

.footer-nav-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-nav ul,
.footer-topics ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-nav a,
.footer-topics a {
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer-nav a:hover,
.footer-topics a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-block: 20px;
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.copyright,
.footer-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   6. Page Hero Sections
   -------------------------------------------------------------------------- */
.page-hero {
  padding-block: 80px 56px;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.page-hero .container { position: relative; z-index: 1; }

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 16px;
  font-family: var(--font-mono);
}

.hero-label::before {
  content: '//';
  opacity: 0.6;
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.page-hero .hero-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 580px;
  line-height: 1.8;
}

/* --------------------------------------------------------------------------
   7. Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

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

.card-inner {
  padding: 28px;
}

/* --------------------------------------------------------------------------
   8. Tags / Badges
   -------------------------------------------------------------------------- */
.tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border-accent);
  white-space: nowrap;
}

.tag-green  { background: rgba(63,185,80,0.1);  color: var(--green);  border-color: rgba(63,185,80,0.3);  }
.tag-orange { background: rgba(210,153,34,0.1); color: var(--orange); border-color: rgba(210,153,34,0.3); }
.tag-purple { background: rgba(188,140,255,0.1);color: var(--purple); border-color: rgba(188,140,255,0.3);}
.tag-red    { background: rgba(248,81,73,0.1);  color: var(--red);    border-color: rgba(248,81,73,0.3);  }

/* --------------------------------------------------------------------------
   9. Section Utilities
   -------------------------------------------------------------------------- */
.section {
  padding-block: 64px;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
  font-family: var(--font-mono);
}

.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 0.975rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 560px;
}

.section-header {
  margin-bottom: 40px;
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-block: 48px;
}

/* --------------------------------------------------------------------------
   10. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-accent);
}
.btn-outline:hover {
  background: var(--accent-dim);
  color: var(--accent-hover);
  border-color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 8px 16px;
}
.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--accent-dim);
  border-color: var(--border-accent);
}

/* --------------------------------------------------------------------------
   11. Post Card Component
   -------------------------------------------------------------------------- */
.post-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.post-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.post-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.post-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 10px;
  transition: color var(--transition);
}

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

.post-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 20px;
}

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

.read-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* --------------------------------------------------------------------------
   12. Featured Post (Large)
   -------------------------------------------------------------------------- */
.featured-post {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 40px;
}

.featured-post:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-lg);
}

.featured-post-visual {
  background: linear-gradient(135deg, #0d1b2a 0%, #1a2744 50%, #0a1628 100%);
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.featured-post-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 40%, rgba(88,166,255,0.2) 0%, transparent 50%),
    radial-gradient(circle at 75% 70%, rgba(188,140,255,0.15) 0%, transparent 45%);
}

.featured-glyph {
  font-size: 5rem;
  line-height: 1;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 20px var(--accent-glow));
  user-select: none;
}

.featured-post-body {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  font-family: var(--font-mono);
}

.featured-badge::before { content: '★'; }

.featured-post-body h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.featured-post-body p {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.featured-post-body .post-meta {
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   13. Grid Layouts
   -------------------------------------------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-block: 48px;
}

.stat-item {
  background: var(--bg-card);
  padding: 28px 24px;
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   14. Testimonials
   -------------------------------------------------------------------------- */
.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.testimonial-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-sm);
}

.testimonial-quote {
  font-size: 2rem;
  color: var(--accent);
  line-height: 1;
  font-family: Georgia, serif;
  opacity: 0.5;
}

.testimonial-card blockquote {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
  font-style: italic;
  flex: 1;
}

.testimonial-author {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.testimonial-role {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   15. Newsletter Strip
   -------------------------------------------------------------------------- */
.newsletter-strip {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.newsletter-strip::before {
  content: '';
  position: absolute;
  top: -60px; left: 50%;
  transform: translateX(-50%);
  width: 400px; height: 200px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.newsletter-strip > * { position: relative; z-index: 1; }

.newsletter-strip h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.newsletter-strip p {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 0.95rem;
}

.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 440px;
  margin-inline: auto;
}

.newsletter-input {
  flex: 1;
  padding: 10px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  transition: border-color var(--transition);
  outline: none;
}

.newsletter-input::placeholder { color: var(--text-muted); }
.newsletter-input:focus { border-color: var(--accent); }

.newsletter-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* --------------------------------------------------------------------------
   16. About Page Specifics
   -------------------------------------------------------------------------- */
.about-hero {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 64px;
  align-items: start;
  padding-block: 80px 60px;
}

.about-avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a2744, #0a1628);
  border: 3px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  margin-bottom: 20px;
  box-shadow: 0 0 0 6px var(--accent-dim);
}

.about-sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  position: sticky;
  top: 84px;
}

.sidebar-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.sidebar-stat:last-child { border-bottom: none; }

.sidebar-stat-label { color: var(--text-secondary); }
.sidebar-stat-value { color: var(--accent); font-family: var(--font-mono); font-weight: 600; }

.skill-bar-container {
  margin-bottom: 16px;
}

.skill-bar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.skill-name { color: var(--text-secondary); }
.skill-pct { color: var(--accent); font-family: var(--font-mono); }

.skill-bar-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 2px;
  width: 0;
  transition: width 1s ease;
}

.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 32px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -28px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.timeline-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   17. Blog Post Page
   -------------------------------------------------------------------------- */
.post-header {
  padding-block: 64px 48px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

.post-body {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-secondary);
}

.post-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-block: 40px 16px;
  letter-spacing: -0.02em;
}

.post-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-block: 28px 12px;
}

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

.post-body ul, .post-body ol {
  list-style: disc;
  padding-left: 24px;
  margin-bottom: 20px;
}

.post-body ol { list-style: decimal; }

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

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--purple);
  border: 1px solid var(--border);
}

.post-body pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  overflow-x: auto;
  margin-bottom: 24px;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 24px;
  font-style: italic;
  color: var(--text-secondary);
}

.post-placeholder {
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 80px 40px;
  text-align: center;
}

.post-placeholder-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.post-placeholder h3 {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.post-placeholder p {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 360px;
  margin-inline: auto;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   18. Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding-inline: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all var(--transition);
}

.page-btn:hover, .page-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--border-accent);
}

/* --------------------------------------------------------------------------
   19. Filter Tabs
   -------------------------------------------------------------------------- */
.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.filter-tab {
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-tab:hover,
.filter-tab.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--border-accent);
}

/* --------------------------------------------------------------------------
   20. Search Bar
   -------------------------------------------------------------------------- */
.search-bar-wrapper {
  position: relative;
  max-width: 380px;
}

.search-bar {
  width: 100%;
  padding: 9px 16px 9px 38px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition);
}

.search-bar::placeholder { color: var(--text-muted); }
.search-bar:focus { border-color: var(--accent); }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   21. Responsive — Tablet
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .post-grid { grid-template-columns: 1fr 1fr; }
  .two-col-grid { grid-template-columns: 1fr; }
  .featured-post { grid-template-columns: 1fr; }
  .featured-post-visual { min-height: 200px; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-brand { grid-column: 1 / -1; }
  .about-hero { grid-template-columns: 1fr; }
  .about-sidebar-card { position: static; }
}

/* --------------------------------------------------------------------------
   22. Responsive — Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  :root { --header-height: 56px; }

  .nav-toggle { display: flex; }

  .primary-nav {
    display: none;
    position: fixed;
    inset: var(--header-height) 0 0 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border);
    padding: 24px;
    z-index: 99;
    overflow-y: auto;
  }

  .primary-nav.open { display: block; }

  .nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .nav-link {
    font-size: 1rem;
    padding: 12px 16px;
    width: 100%;
  }

  .post-grid { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom-inner { flex-direction: column; text-align: center; }

  .newsletter-form { flex-direction: column; }

  .featured-post-body { padding: 24px; }

  .page-hero { padding-block: 48px 36px; }

  .about-avatar { width: 120px; height: 120px; font-size: 2.5rem; }
}

/* --------------------------------------------------------------------------
   23. Scroll-to-top button
   -------------------------------------------------------------------------- */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity var(--transition), transform var(--transition);
  border: none;
  cursor: pointer;
  z-index: 90;
}

.scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top:hover { background: var(--accent-hover); }

/* --------------------------------------------------------------------------
   24. Utility
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.text-accent { color: var(--accent); }
.text-muted  { color: var(--text-muted); }
.text-mono   { font-family: var(--font-mono); }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0  { margin-bottom: 0 !important; }

/* Fade-in on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}