/* Everforest Dark + JetBrains-inspired Modern UI */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Everforest palette */
  --bg0: #2d353b;
  --bg1: #343f44;
  --bg2: #3d484d;
  --bg3: #475258;
  --bg4: #4f5b62;
  --fg: #d3c6aa;
  --fg-dim: #859289;
  --red: #e67e80;
  --orange: #e69875;
  --yellow: #dbbc7f;
  --green: #a7c080;
  --aqua: #83c092;
  --blue: #7fbbb3;
  --purple: #d699b6;
  
  /* Gradient accents */
  --gradient-primary: linear-gradient(135deg, var(--green) 0%, var(--aqua) 100%);
  --gradient-subtle: linear-gradient(135deg, rgba(167, 192, 128, 0.1) 0%, rgba(131, 192, 146, 0.05) 100%);
  --gradient-card: linear-gradient(145deg, rgba(52, 63, 68, 0.8) 0%, rgba(61, 72, 77, 0.6) 100%);
  --gradient-glow: radial-gradient(ellipse at 50% 0%, rgba(167, 192, 128, 0.15) 0%, transparent 60%);
  
  /* Glass effect */
  --glass-bg: rgba(52, 63, 68, 0.7);
  --glass-border: rgba(71, 82, 88, 0.5);
  --glass-blur: 20px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg0);
  color: var(--fg);
  line-height: 1.7;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Interactive node graph background */
.node-graph-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Ambient background glow */
.page-glow {
  position: fixed;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 150%;
  height: 100%;
  background: var(--gradient-glow);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  position: relative;
  z-index: 1;
}

/* ============================================
   Site Header
   ============================================ */
.site-header {
  text-align: center;
  margin-bottom: 4rem;
  animation: fadeInDown 0.6s ease backwards;
}

.site-title {
  font-size: 3.5rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 60px rgba(167, 192, 128, 0.3);
}

.site-tagline {
  color: var(--fg-dim);
  font-weight: 300;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  color: var(--fg);
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.3;
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  color: var(--aqua);
}

/* ============================================
   Post Cards (List View)
   ============================================ */
.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.post-card {
  background: var(--gradient-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.post-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-subtle);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(167, 192, 128, 0.3);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 60px rgba(167, 192, 128, 0.1);
}

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

.post-card-banner {
  height: 140px;
  overflow: hidden;
  position: relative;
}

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

.post-card:hover .post-card-banner img {
  transform: scale(1.05);
}

.post-card-content {
  padding: 1.5rem 1.75rem;
  position: relative;
}

.post-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  display: block;
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

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

.post-card-summary {
  font-size: 0.95rem;
  color: var(--fg-dim);
  margin-bottom: 0;
  line-height: 1.5;
  font-weight: 300;
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--fg-dim);
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.8;
}

.post-card-meta svg {
  width: 14px;
  height: 14px;
}

.post-card-author {
  color: var(--green);
}

.post-card-meta-divider {
  opacity: 0.5;
}

/* Staggered animations */
.post-card {
  animation: fadeInUp 0.5s ease backwards;
}
.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.15s; }
.post-card:nth-child(3) { animation-delay: 0.2s; }
.post-card:nth-child(4) { animation-delay: 0.25s; }
.post-card:nth-child(5) { animation-delay: 0.3s; }
.post-card:nth-child(6) { animation-delay: 0.35s; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--fg-dim);
  background: var(--gradient-card);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

/* ============================================
   Post Detail
   ============================================ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--fg-dim);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2rem;
  padding: 0.6rem 1.25rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  transition: all 0.2s ease;
}

.back-link:hover {
  color: var(--green);
  border-color: rgba(167, 192, 128, 0.3);
  background: rgba(167, 192, 128, 0.1);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

/* Article container */
.post {
  background: var(--gradient-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  overflow: hidden;
  animation: fadeInUp 0.6s ease backwards;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

/* Banner */
.post-banner {
  position: relative;
  height: 280px;
  overflow: hidden;
}

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

.post-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    transparent 40%,
    rgba(45, 53, 59, 0.6) 70%,
    rgba(45, 53, 59, 0.95) 100%
  );
}

/* Post header */
.post-header {
  padding: 3rem 2.5rem 0;
  margin-bottom: 2rem;
}

.post-header.has-banner {
  margin-top: -80px;
  position: relative;
  z-index: 2;
}

.post-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--fg);
}

.post-summary {
  font-size: 1.2rem;
  color: var(--fg-dim);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--fg-dim);
  font-size: 0.9rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(71, 82, 88, 0.5);
}

.post-meta-divider {
  width: 4px;
  height: 4px;
  background: var(--bg3);
  border-radius: 50%;
}

.post-author {
  color: var(--green);
  font-weight: 500;
}

/* Post body */
.post-body {
  padding: 2rem 2.5rem 2.5rem;
}

/* Content headings */
.post-body h1 {
  font-size: 1.875rem;
  color: var(--green);
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg3);
}

.post-body h1:first-child {
  margin-top: 0;
}

.post-body h2 {
  font-size: 1.5rem;
  color: var(--aqua);
  margin-top: 2.5rem;
}

.post-body h3 {
  font-size: 1.25rem;
  color: var(--blue);
  margin-top: 2rem;
}

.post-body h4 {
  font-size: 1.1rem;
  color: var(--purple);
  margin-top: 1.5rem;
}

.post-body h5,
.post-body h6 {
  font-size: 1rem;
  color: var(--fg-dim);
  margin-top: 1.25rem;
}

/* Lists */
.post-body ul,
.post-body ol {
  margin: 1.25rem 0 1.25rem 1.5rem;
}

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

.post-body ul li::marker {
  color: var(--green);
}

.post-body ol li::marker {
  color: var(--aqua);
  font-weight: 600;
}

/* Images */
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.5rem 0;
  display: block;
  border: 1px solid var(--bg3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.post-body p > img {
  margin: 1.5rem auto;
}

/* Aside callouts */
.post-body aside {
  background: var(--gradient-subtle);
  border-left: 3px solid var(--aqua);
  border-radius: 0 12px 12px 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.post-body aside img {
  display: inline;
  margin: 0 0.5rem 0 0;
  vertical-align: middle;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

/* ============================================
   Code Blocks
   ============================================ */
code {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875em;
}

p code, li code {
  background: rgba(61, 72, 77, 0.8);
  padding: 0.2em 0.5em;
  border-radius: 6px;
  color: var(--orange);
  font-size: 0.85em;
}

.highlight {
  background: linear-gradient(145deg, rgba(45, 53, 59, 0.9) 0%, rgba(52, 63, 68, 0.9) 100%);
  border: 1px solid var(--bg3);
  border-radius: 14px;
  margin: 1.75rem 0;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.post-body .highlight {
  margin-left: -0.5rem;
  margin-right: -0.5rem;
}

.highlight::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 18px 0 0 var(--yellow), 36px 0 0 var(--green);
  z-index: 1;
}

.highlight pre {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 3rem 1.5rem 1.5rem;
  margin: 0;
  overflow-x: auto;
}

.highlight pre code {
  background: transparent;
  padding: 0;
}

pre:not(.highlight pre) {
  background: linear-gradient(145deg, rgba(45, 53, 59, 0.9) 0%, rgba(52, 63, 68, 0.9) 100%);
  border: 1px solid var(--bg3);
  border-radius: 14px;
  padding: 3rem 1.5rem 1.5rem;
  overflow-x: auto;
  margin: 1.75rem 0;
  position: relative;
}

pre:not(.highlight pre)::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 18px 0 0 var(--yellow), 36px 0 0 var(--green);
}

pre:not(.highlight pre) code {
  background: transparent;
  padding: 0;
}

/* ============================================
   Pygments Syntax Highlighting - Everforest
   ============================================ */
.highlight .hll { background-color: var(--bg2); }
.highlight .c   { color: var(--fg-dim); font-style: italic; }
.highlight .err { color: var(--red); }
.highlight .k   { color: var(--red); font-weight: 500; }
.highlight .o   { color: var(--aqua); }
.highlight .p   { color: var(--fg); }
.highlight .ch  { color: var(--fg-dim); font-style: italic; }
.highlight .cm  { color: var(--fg-dim); font-style: italic; }
.highlight .cp  { color: var(--aqua); }
.highlight .cpf { color: var(--fg-dim); font-style: italic; }
.highlight .c1  { color: var(--fg-dim); font-style: italic; }
.highlight .cs  { color: var(--fg-dim); font-style: italic; }
.highlight .gd  { color: var(--red); }
.highlight .ge  { font-style: italic; }
.highlight .gh  { color: var(--green); font-weight: 600; }
.highlight .gi  { color: var(--green); }
.highlight .go  { color: var(--fg-dim); }
.highlight .gp  { color: var(--aqua); font-weight: 600; }
.highlight .gs  { font-weight: 600; }
.highlight .gu  { color: var(--aqua); font-weight: 600; }
.highlight .gt  { color: var(--red); }
.highlight .kc  { color: var(--red); font-weight: 500; }
.highlight .kd  { color: var(--red); font-weight: 500; }
.highlight .kn  { color: var(--purple); font-weight: 500; }
.highlight .kp  { color: var(--red); }
.highlight .kr  { color: var(--red); font-weight: 500; }
.highlight .kt  { color: var(--yellow); }
.highlight .m   { color: var(--purple); }
.highlight .s   { color: var(--green); }
.highlight .na  { color: var(--blue); }
.highlight .nb  { color: var(--aqua); }
.highlight .nc  { color: var(--yellow); font-weight: 500; }
.highlight .no  { color: var(--orange); }
.highlight .nd  { color: var(--aqua); font-weight: 500; }
.highlight .ni  { color: var(--fg); font-weight: 600; }
.highlight .ne  { color: var(--red); font-weight: 500; }
.highlight .nf  { color: var(--green); }
.highlight .nl  { color: var(--aqua); }
.highlight .nn  { color: var(--yellow); }
.highlight .nt  { color: var(--orange); }
.highlight .nv  { color: var(--blue); }
.highlight .ow  { color: var(--purple); font-weight: 500; }
.highlight .w   { color: var(--fg-dim); }
.highlight .mb  { color: var(--purple); }
.highlight .mf  { color: var(--purple); }
.highlight .mh  { color: var(--purple); }
.highlight .mi  { color: var(--purple); }
.highlight .mo  { color: var(--purple); }
.highlight .sa  { color: var(--green); }
.highlight .sb  { color: var(--green); }
.highlight .sc  { color: var(--green); }
.highlight .dl  { color: var(--green); }
.highlight .sd  { color: var(--fg-dim); font-style: italic; }
.highlight .s2  { color: var(--green); }
.highlight .se  { color: var(--orange); }
.highlight .sh  { color: var(--green); }
.highlight .si  { color: var(--aqua); }
.highlight .sx  { color: var(--green); }
.highlight .sr  { color: var(--aqua); }
.highlight .s1  { color: var(--green); }
.highlight .ss  { color: var(--aqua); }
.highlight .bp  { color: var(--aqua); }
.highlight .fm  { color: var(--green); }
.highlight .vc  { color: var(--blue); }
.highlight .vg  { color: var(--blue); }
.highlight .vi  { color: var(--blue); }
.highlight .vm  { color: var(--blue); }
.highlight .il  { color: var(--purple); }

/* ============================================
   Blockquotes
   ============================================ */
blockquote {
  position: relative;
  background: linear-gradient(90deg, rgba(214, 153, 182, 0.1) 0%, transparent 100%);
  border-left: 3px solid var(--purple);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: var(--fg-dim);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ============================================
   Tables
   ============================================ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(45, 53, 59, 0.5);
}

th, td {
  border: 1px solid var(--bg3);
  padding: 0.875rem 1rem;
  text-align: left;
}

th {
  background: rgba(61, 72, 77, 0.8);
  color: var(--green);
  font-weight: 600;
}

tr:nth-child(even) {
  background: rgba(61, 72, 77, 0.3);
}

hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--bg3), transparent);
  margin: 3rem 0;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
  .container {
    padding: 2rem 1rem;
  }
  
  .site-title {
    font-size: 2.5rem;
  }
  
  .post-title {
    font-size: 2rem;
  }
  
  .post-summary {
    font-size: 1.05rem;
  }
  
  .post-header {
    padding: 2rem 1.5rem 0;
  }
  
  .post-header.has-banner {
    margin-top: -60px;
  }
  
  .post-banner {
    height: 200px;
  }
  
  .post-body {
    padding: 1.5rem;
  }
  
  .post-body h1 {
    font-size: 1.5rem;
  }
  
  .post-body h2 {
    font-size: 1.3rem;
  }
  
  .post-card-banner {
    height: 120px;
  }
  
  pre, .highlight pre {
    padding: 2.5rem 1rem 1rem;
  }
}

/* ============================================
   Selection & Scrollbar
   ============================================ */
::selection {
  background: var(--green);
  color: var(--bg0);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg0);
}

::-webkit-scrollbar-thumb {
  background: var(--bg3);
  border-radius: 5px;
  border: 2px solid var(--bg0);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--fg-dim);
}
