:root {
  --color-accent: #0d7c4a;
  --color-accent-light: #e6f4ed;
  --color-accent-glow: #10b96f;
  --color-text: #1a1a2e;
  --color-text-mid: #4a4a68;
  --color-text-light: #7c7c96;
  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-border: #e8e8e4;
  --color-border-light: #f0f0ec;
  --color-code-bg: #1c1f2b;
  --color-code-text: #e4e8f0;
  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "Instrument Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
  --max-width: 740px;
  --max-width-wide: 1140px;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.72;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ═══════════════════════════════════════
   HEADER
   ═══════════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 249, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  padding: 0.9rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.02em;
}

.site-title-icon {
  color: var(--color-accent);
  font-size: 1.3rem;
  line-height: 1;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.main-nav a {
  color: var(--color-text-mid);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.main-nav a:hover {
  color: var(--color-accent);
  background: var(--color-accent-light);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* ═══════════════════════════════════════
   HERO
   ═══════════════════════════════════════ */

.hero {
  padding: 5rem 0 4rem;
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
  border-bottom: 1px solid var(--color-border-light);
}

.hero .container {
  max-width: 800px;
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3.2rem;
  line-height: 1.15;
  color: var(--color-text);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

.hero-accent {
  color: var(--color-accent);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--color-text-mid);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.hero-stats {
  display: flex;
  gap: 2.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--color-text);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

/* ═══════════════════════════════════════
   POST GRID (Homepage)
   ═══════════════════════════════════════ */

.latest-posts {
  padding: 4rem 0;
}

.section-header {
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.section-sub {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
}

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

.post-card-category {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.post-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.35;
  margin-bottom: 0.6rem;
}

.post-card h3 a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.2s;
}

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

.post-card-excerpt {
  color: var(--color-text-mid);
  font-size: 0.9rem;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}

.post-card-footer {
  display: flex;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border-light);
}

.post-card-footer .post-meta {
  font-size: 0.78rem;
  color: var(--color-text-light);
  font-weight: 500;
}

/* ═══════════════════════════════════════
   ARTICLE PAGE
   ═══════════════════════════════════════ */

.post-header {
  padding: 3.5rem 0 2.5rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-light);
}

.post-header .container {
  max-width: var(--max-width);
}

.post-category-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.post-header h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  max-width: 680px;
}

.post-meta-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.meta-sep { opacity: 0.4; }

.post-body {
  max-width: var(--max-width);
  padding: 3rem 2rem;
}

.post-content h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  margin: 3rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-light);
  color: var(--color-text);
}

.post-content h2:first-child {
  border-top: none;
  padding-top: 0;
}

.post-content h3 {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--color-text);
}

.post-content p {
  margin-bottom: 1.3rem;
  color: var(--color-text-mid);
}

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

.post-content ul, .post-content ol {
  margin: 0 0 1.4rem 1.25rem;
  color: var(--color-text-mid);
}

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

.post-content code {
  font-family: var(--font-mono);
  background: var(--color-accent-light);
  color: var(--color-accent);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 500;
}

.post-content pre {
  background: var(--color-code-bg);
  color: var(--color-code-text);
  padding: 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0 1.8rem;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow-md);
}

.post-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.65;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: 0.9rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.post-content th {
  background: var(--color-accent-light);
  color: var(--color-accent);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--color-accent);
}

.post-content td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text-mid);
}

.post-content tr:last-child td {
  border-bottom: none;
}

.post-content tr:hover td {
  background: rgba(13, 124, 74, 0.03);
}

.post-content blockquote {
  border-left: 3px solid var(--color-accent);
  background: var(--color-accent-light);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--color-text-mid);
}

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

/* ═══════════════════════════════════════
   CTA BOX
   ═══════════════════════════════════════ */

.post-cta {
  background: linear-gradient(135deg, var(--color-accent-light) 0%, #f0faf5 100%);
  border: 1px solid rgba(13, 124, 74, 0.15);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-top: 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.post-cta::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(13, 124, 74, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.cta-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.post-cta h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.post-cta p {
  color: var(--color-text-mid);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.cta-button {
  display: inline-block;
  background: var(--color-accent);
  color: white;
  padding: 0.8rem 1.75rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(13, 124, 74, 0.25);
}

.cta-button:hover {
  background: #0a6b3e;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(13, 124, 74, 0.3);
}

/* ═══════════════════════════════════════
   POST NAVIGATION
   ═══════════════════════════════════════ */

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.2s ease;
}

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

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

.post-nav-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
}

.post-nav-title {
  font-size: 0.9rem;
  color: var(--color-text);
  font-weight: 500;
}

/* ═══════════════════════════════════════
   CATEGORY LIST PAGE
   ═══════════════════════════════════════ */

.post-list {
  max-width: var(--max-width);
}

.post-list .post-card {
  margin-bottom: 1rem;
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */

.site-footer {
  margin-top: 5rem;
  padding: 3rem 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

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

.footer-brand {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.footer-brand .site-title-icon {
  color: var(--color-accent);
}

.footer-tagline {
  color: var(--color-text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.footer-copy {
  color: var(--color-text-light);
  font-size: 0.78rem;
  opacity: 0.7;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 1rem 2rem;
    box-shadow: var(--shadow-md);
  }

  .main-nav.active { display: flex; }

  .main-nav a {
    padding: 0.6rem 0;
    font-size: 0.95rem;
  }

  .hero { padding: 3rem 0 2.5rem; }
  .hero h1 { font-size: 2.2rem; }
  .hero-stats { gap: 1.5rem; }

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

  .post-header h1 { font-size: 1.9rem; }

  .post-body { padding: 2rem 1.5rem; }

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

  .post-content h2 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .container { padding: 0 1.25rem; }
  .hero h1 { font-size: 1.8rem; }
  .stat-num { font-size: 1.4rem; }
  .post-card { padding: 1.25rem; }
  .post-header h1 { font-size: 1.6rem; }
}

/* ═══════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════ */

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

.hero-badge,
.hero h1,
.hero-sub,
.hero-stats {
  animation: fadeUp 0.6s ease both;
}

.hero h1 { animation-delay: 0.1s; }
.hero-sub { animation-delay: 0.2s; }
.hero-stats { animation-delay: 0.3s; }

.post-card {
  animation: fadeUp 0.5s ease both;
}

.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.1s; }
.post-card:nth-child(3) { animation-delay: 0.15s; }
.post-card:nth-child(4) { animation-delay: 0.2s; }
.post-card:nth-child(5) { animation-delay: 0.25s; }
.post-card:nth-child(6) { animation-delay: 0.3s; }
