@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Source+Sans+3:wght@400;500;600&display=swap');

/* ============================================================
   CJStudio Theme v1.3 — style.css
   Light: ice white + navy + blue
   Dark:  black + gold
   
   Changes from v1.2:
   - Wider layout: 960px → 1280px
   - Bigger fonts across all elements for 1920x1080
   - Section labels now proper headings
   - Consistent font sizing between homepage and inner pages
   - Article cards with feature image support
   - Newsletter dark mode fix
   - Improved dark mode text contrast
   ============================================================ */

   /* test webhook sync 3 */

:root {
  --bg: #F8FAFF;
  --bg-alt: #EEF2F7;
  --text: #1B2E4B;
  --text-muted: #5A7299;
  --text-faint: #8BA3BF;
  --accent: #1B6FC9;
  --accent2: #00aa88;
  --border: #E2E8F4;
  --card-bg: #ffffff;
  --navbar-bg: #F8FAFF;
  --footer-bg: #1B2E4B;
  --footer-text: #7A9ABF;
  --footer-accent: #5B9BD5;
  --hero-glow-color: #DCEAFB;
  --nl-bg: #1B2E4B;
  --nl-text: #ffffff;
  --nl-muted: rgba(255,255,255,0.4);
  --nl-input-border: rgba(255,255,255,0.15);
  --nl-input-bg: rgba(255,255,255,0.07);
  --font: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.dark {
  --bg: #07111e;
  --bg-alt: #0a1525;
  --text: #ddeeff;
  --text-muted: #6e8caf;
  --text-faint: #4a6a8a;
  --accent: #4a9eff;
  --accent2: #00d4aa;
  --border: rgba(74,158,255,0.12);
  --card-bg: #0a1828;
  --navbar-bg: #07111e;
  --footer-bg: #060e1a;
  --footer-text: #6e8caf;
  --footer-accent: #4a9eff;
  --hero-glow-color: rgba(74,158,255,0.10);
  --nl-bg: #0a1828;
  --nl-text: #ddeeff;
  --nl-muted: rgba(221,238,255,0.4);
  --nl-input-border: rgba(74,158,255,0.2);
  --nl-input-bg: rgba(74,158,255,0.05);
}

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

html { scroll-behavior: smooth; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
}

body {
  font-family: var(--font);
  background: var(--bg-alt);
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}

.site {
  width: 100%;
  background: var(--bg);
  min-height: 100vh;
}

/* ── NAVBAR ─────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px max(40px, calc((100% - 1200px) / 2));
  border-bottom: 1px solid var(--border);
  background: var(--navbar-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar.scrolled {
  background: color-mix(in srgb, var(--navbar-bg) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--accent); }

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

.toggle-btn {
  font-size: 13px;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s;
}
.toggle-btn:hover { border-color: var(--accent); }

.subscribe-btn {
  font-size: 13px;
  padding: 8px 18px;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s;
}
.subscribe-btn:hover { opacity: 0.9; }

/* ── LANGUAGE TOGGLE ────────────────────────────────────── */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
}
.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-heading);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s;
  line-height: 1;
}
.lang-btn.active {
  color: var(--accent);
  font-weight: 600;
}
.lang-btn:hover { color: var(--text); }
.lang-separator {
  color: var(--text-muted);
  margin: 0 2px;
  font-size: 12px;
  user-select: none;
}
.zh-text { display: none; }
.lang-zh .zh-text { display: inline; }
.lang-zh .en-text { display: none; }

/* ── LANG SWITCHER BAR ──────────────────────────────────── */
.lang-switcher-bar {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.lang-switch-link { color: var(--accent); text-decoration: none; }
.lang-switch-link:hover { text-decoration: underline; }

/* ── HERO ───────────────────────────────────────────────── */
@keyframes heroGlow {
  0%, 100% { background: var(--bg); }
  50% { background: var(--hero-glow-color); }
}

@keyframes avatarFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes avatarPulse {
  0%, 100% {
    box-shadow:
      0 0 0 0   color-mix(in srgb, var(--accent) 55%, transparent),
      0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 10px color-mix(in srgb, var(--accent) 0%,  transparent),
      0 0 0 6px  color-mix(in srgb, var(--accent) 8%,  transparent);
  }
}

@keyframes titleShimmer {
  0%   { left: -60%; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { left: 120%; opacity: 0; }
}


.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 48px;
  align-items: center;
  padding: 60px max(40px, calc((100% - 1200px) / 2));
  border-bottom: 1px solid var(--border);
  position: relative;
  background-image: url(../images/hero-bg.jpg);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(248, 250, 255, 0.82) 0%,
    rgba(248, 250, 255, 0.65) 50%,
    rgba(248, 250, 255, 0.78) 100%
  );
  z-index: 1;
}
body.dark .hero::before {
  background: rgba(13, 13, 13, 0.35);
}

.hero > div:nth-child(2) {
  position: relative;
  z-index: 2;
}
.hero-photo {
  position: relative;
  z-index: 2;
}
.hero-cta {
  position: relative;
  z-index: 2;
}
#heroParticles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.45;
}
body.dark #heroParticles {
  opacity: 0.5;
}

.hero-greeting { display: none; }

.hero-typewriter-line {
  display: flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  color: var(--accent2);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
  min-height: 36px;
}

#heroTypewriter { color: var(--accent2); }

.hero-name {
  font-size: 58px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 12px;
  letter-spacing: -1.5px;
  position: relative;
  overflow: hidden;
  opacity: 1;
}
.hero-name span { color: var(--accent2); }
.hero-name::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--accent) 40%, transparent) 50%,
    transparent 100%
  );
  animation: titleShimmer 1.8s ease-out 0.4s 1 forwards;
  pointer-events: none;
}

.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 520px;
  margin-bottom: 28px;
  opacity: 1;
}

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

.btn-primary {
  font-size: 14px;
  padding: 11px 24px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 45%, transparent);
}

.btn-secondary {
  font-size: 14px;
  padding: 11px 24px;
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s;
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 20%, transparent);
}

.hero-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  animation: avatarFloat 3s ease-in-out infinite, avatarPulse 2.5s ease-in-out infinite;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* ── SECTIONS ───────────────────────────────────────────── */
.section {
  padding: 40px max(40px, calc((100% - 1200px) / 2));
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

/* ── LATEST GRID ────────────────────────────────────────── */
.latest-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.latest-grid:has(> .latest-card:only-child) {
  grid-template-columns: minmax(0, 480px);
}

.latest-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(40px);
  background: var(--card-bg);
  text-decoration: none;
  display: block;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.3s, transform 0.3s, opacity 0.5s ease-out;
  overflow: hidden;
}
.latest-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 20%, transparent));
  border-radius: 12px 12px 0 0;
  opacity: 0.2;
  transition: opacity 0.3s;
}
.latest-card:hover::after { opacity: 1; }
.latest-card:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--accent) 15%, transparent);
  transform: translateY(-6px);
}

.card-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 14px;
  transition: transform 0.4s ease;
}
.latest-card:hover .card-image {
  transform: scale(1.05);
}

.card-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font-weight: 600;
  display: inline-block;
  margin-bottom: 10px;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.card-excerpt {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 13px;
  color: var(--text-faint);
}

/* ── TOPIC EXPLORER (2×2 cards + panel) ─────────────────── */
.explorer-new {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
  align-items: start;
}

.topic-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.topic-card-btn {
  cursor: pointer;
  border-radius: 16px;
  padding: 24px 20px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  text-align: left;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
  width: 100%;
}
.topic-card-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 12%, transparent);
}
.topic-card-btn.active {
  border-color: var(--accent);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--accent) 15%, transparent);
}
.tc-active-bar {
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.topic-card-btn.active .tc-active-bar { opacity: 1; }

.tc-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 14px;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-alt));
  border: 1px solid transparent;
  transition: all 0.2s;
}
.topic-card-btn.active .tc-icon,
.topic-card-btn:hover .tc-icon {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.tc-name {
  font-family: var(--font-heading);
  font-size: 16px; font-weight: 700;
  color: var(--text);
  margin-bottom: 4px; letter-spacing: -0.01em;
  transition: color 0.2s;
}
.topic-card-btn.active .tc-name,
.topic-card-btn:hover .tc-name { color: var(--accent); }

.tc-desc {
  font-size: 13px; color: var(--text-muted);
  line-height: 1.5; margin-bottom: 12px;
}

.tc-count {
  font-size: 12px; font-weight: 600;
  color: var(--text-faint); letter-spacing: 0.04em;
  transition: color 0.2s;
}
.topic-card-btn.active .tc-count { color: var(--accent); }

/* ── TOPIC PANEL ──────────────────────────────────────────── */
.topic-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  border-top: 3px solid var(--accent);
  min-height: 280px;
}
.tp-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.tp-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 4px;
}
.tp-title {
  font-family: var(--font-heading);
  font-size: 22px; font-weight: 700;
  color: var(--text); letter-spacing: -0.02em;
}
.tp-view-all {
  font-size: 13px; color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 20px; padding: 6px 16px;
  text-decoration: none; font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
  transition: background 0.15s;
}
.tp-view-all:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }

.tp-articles { display: flex; flex-direction: column; }
.tp-row {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  border-radius: 6px;
  transition: padding-left 0.2s, background 0.2s;
}
.tp-row:last-child { border-bottom: none; }
.tp-row:hover {
  padding-left: 6px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.tp-num { font-size: 13px; color: var(--text-faint); font-weight: 700; min-width: 26px; padding-top: 2px; }
.tp-body { flex: 1; }
.tp-art-title {
  font-family: var(--font-heading);
  font-size: 15px; font-weight: 500;
  color: var(--text); line-height: 1.45;
  margin-bottom: 4px; transition: color 0.15s;
}
.tp-row:hover .tp-art-title { color: var(--accent); }
.tp-art-meta { font-size: 12px; color: var(--text-faint); }
.tp-arrow { font-size: 15px; color: var(--text-faint); padding-top: 2px; }

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

.no-posts {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 10px;
  animation: contentFadeIn 0.3s ease both;
}
.no-posts-icon {
  font-size: 28px;
  color: var(--accent);
  opacity: 0.35;
  line-height: 1;
}
.no-posts-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
}
.no-posts-sub {
  font-size: 13px;
  color: var(--text-faint);
}

/* ── NEWSLETTER ─────────────────────────────────────────── */
.nl-wrap {
  padding: 40px max(40px, calc((100% - 1200px) / 2));
  border-bottom: 1px solid var(--border);
}

.nl-box {
  background-color: var(--nl-bg);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--accent) 8%, transparent) 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: 12px;
  padding: 32px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
}

.nl-text h3 { font-size: 18px; font-weight: 600; color: var(--nl-text); margin-bottom: 6px; }
.nl-text p { font-size: 14px; color: var(--nl-muted); }
.nl-form { display: flex; gap: 10px; flex-shrink: 0; }

.nl-input {
  font-size: 14px;
  padding: 10px 16px;
  border: 1px solid var(--nl-input-border);
  border-radius: 8px;
  background: var(--nl-input-bg);
  color: #fff;
  width: 200px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.nl-input::placeholder { color: rgba(255,255,255,0.3); }
.nl-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.nl-btn {
  font-size: 14px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s;
  animation: nlBtnPulse 2.5s ease-in-out infinite;
}
.nl-btn:hover { opacity: 0.9; }

@keyframes nlBtnPulse {
  0%, 100% { box-shadow: 0 0 0 0   color-mix(in srgb, var(--accent) 55%, transparent); }
  50%       { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%,  transparent); }
}

/* ── SECTION FADE-IN (IntersectionObserver) ─────────────── */
.fade-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── FOOTER ─────────────────────────────────────────────── */
.footer { background: var(--footer-bg); }

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 48px max(40px, calc((100% - 1200px) / 2)) 36px;
}

.ft-brand-name { font-family: var(--font-heading); font-size: 20px; font-weight: 700; color: #fff; letter-spacing: -0.01em; margin-bottom: 12px; }
.ft-brand-name span { color: var(--footer-accent); }
.ft-brand-desc { font-size: 14px; color: var(--footer-text); line-height: 1.75; max-width: 260px; margin-bottom: 20px; }
.ft-socials { display: flex; gap: 10px; }
.ft-social {
  width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--footer-text);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.ft-social svg { width: 15px; height: 15px; fill: currentColor; display: block; }
.ft-social:hover { border-color: var(--footer-accent); color: var(--footer-accent); }
.ft-col-title { font-size: 13px; font-weight: 600; color: var(--footer-accent); letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 16px; }
.ft-links { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.ft-links a { font-size: 14px; color: var(--footer-text); text-decoration: none; transition: color 0.15s; }
.ft-links a:hover { color: var(--footer-accent); }
.ft-divider { border: none; border-top: 1px solid rgba(255,255,255,0.06); margin: 0 max(40px, calc((100% - 1200px) / 2)); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 18px max(40px, calc((100% - 1200px) / 2)); }
.ft-copy { font-size: 13px; color: var(--footer-text); }
.ft-bottom-links { display: flex; gap: 20px; }
.ft-bottom-links a { font-size: 13px; color: var(--footer-text); text-decoration: none; }
.ft-bottom-links a:hover { color: var(--footer-accent); }

/* ── TAG HEADER ─────────────────────────────────────────── */
.tag-header {
  padding: 48px max(40px, calc((100% - 1200px) / 2)) 28px;
  border-bottom: 1px solid var(--border);
}
.tag-title { font-size: 32px; font-weight: 700; color: var(--text); margin: 8px 0; }
.tag-desc { font-size: 16px; color: var(--text-muted); margin-top: 10px; line-height: 1.6; }

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

/* ── STATIC PAGE HERO ───────────────────────────────────── */
.page-hero {
  padding: 80px max(40px, calc((100% - 1200px) / 2)) 60px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  animation: heroGlow 6s ease-in-out infinite;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.2;
  max-width: 720px;
  margin: 0 auto;
}

/* ── POST LAYOUT (two-column) ───────────────────────────── */
.post-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 40px 0;
  align-items: start;
}

.post-layout .post-container {
  max-width: none;
  margin: 0;
  padding: 0 0 56px;
}

/* ── POST SIDEBAR ───────────────────────────────────────── */
.post-sidebar {
  position: sticky;
  top: 100px;
}

.post-sidebar-inner {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  padding: 0 10px;
  margin-bottom: 8px;
}

/* ── Sidebar topic header button ── */
.snav-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 6px;
  text-align: left;
  color: var(--text);
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: inset 3px 0 0 transparent;
}
.snav-header:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 40%, transparent),
              inset 8px 0 16px color-mix(in srgb, var(--accent) 6%, transparent);
}
.snav-topic.expanded .snav-header {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: inset 3px 0 0 var(--accent),
              inset 8px 0 20px color-mix(in srgb, var(--accent) 12%, transparent);
}
.snav-topic.expanded .snav-header .pillar-name { color: var(--accent); }

/* ── Chevron arrow ── */
.snav-chevron {
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--text-faint);
  border-bottom: 2px solid var(--text-faint);
  transform: rotate(-45deg);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 2px;
}
.snav-topic.expanded .snav-chevron { transform: rotate(45deg); }

/* ── Expandable article list ── */
.snav-articles {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin-left: 18px;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.snav-topic.expanded .snav-articles { max-height: 600px; }

.snav-article {
  display: block;
  padding: 5px 8px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s;
}
.snav-article:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }

.snav-art-title {
  display: block;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  transition: color 0.15s;
}
.snav-article:hover .snav-art-title,
.snav-article.current .snav-art-title { color: var(--accent); }
.snav-article.current .snav-art-title { font-weight: 600; }

.snav-art-date {
  display: block;
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 1px;
}

.snav-view-all {
  display: block;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 8px 4px;
  margin-top: 2px;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.snav-view-all:hover { opacity: 1; }

.snav-empty {
  display: block;
  font-size: 12px;
  color: var(--text-faint);
  padding: 4px 8px;
  font-style: italic;
}

.pillar-icon {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.pillar-name {
  font-size: 14px;
  line-height: 1.3;
}

/* ── POST PAGE ──────────────────────────────────────────── */
.post-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 56px 40px;
}

.post-header { margin-bottom: 44px; }

.post-tag {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  display: inline-block;
  margin-bottom: 14px;
}

.post-title {
  font-size: 38px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 18px;
}

.post-meta {
  font-size: 15px;
  color: var(--text-faint);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 28px;
}

.reading-time::before {
  content: '⏱ ';
  font-style: normal;
}

@keyframes featureImageFadeIn {
  from { opacity: 0; transform: scale(0.99); }
  to   { opacity: 1; transform: scale(1); }
}

.post-feature-figure {
  margin-top: 28px;
  margin-bottom: 0;
}

.post-feature-image {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.14);
  animation: featureImageFadeIn 0.7s ease both;
}

.post-feature-caption {
  font-size: 13px;
  color: var(--text-faint);
  text-align: center;
  margin-top: 10px;
  font-style: italic;
  line-height: 1.5;
}

/* ── POST CONTENT BODY ──────────────────────────────────── */
.post-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
}

.post-content p {
  margin-bottom: 1.4em;
  font-size: 18px;
  line-height: 1.8;
  color: var(--text);
}

.post-content h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  margin: 2em 0 0.6em;
  line-height: 1.3;
  border-left: 4px solid var(--accent);
  padding-left: 12px;
}

.post-content h3 {
  font-size: 21px;
  font-weight: 600;
  color: var(--accent);
  margin: 1.6em 0 0.5em;
}

.post-content h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 1.4em 0 0.4em;
}

.post-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 24px;
  margin: 1.6em 0;
  color: var(--text-muted);
  font-style: italic;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
  border-radius: 0 8px 8px 0;
  line-height: 1.8;
}

.post-content ul, .post-content ol {
  margin: 1em 0 1.4em 1.5em;
}

.post-content li {
  margin-bottom: 0.4em;
  font-size: 17px;
  line-height: 1.7;
}

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

.post-content code {
  font-family: 'Courier New', monospace;
  font-size: 15px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
}

.post-content pre {
  background: #1a1a2e;
  color: #e2e8f0;
  padding: 24px 28px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 1.6em 0;
  font-size: 14px;
  line-height: 1.7;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

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

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.6em 0;
}

.post-content hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 20%, var(--accent) 80%, transparent);
  opacity: 0.55;
  margin: 2.5em 0;
  border-radius: 2px;
}

/* Ghost card widths */
.kg-width-wide { margin-left: -100px; margin-right: -100px; }
.kg-width-full { margin-left: -40px; margin-right: -40px; }

/* ── POST FOOTER ─────────────────────────────────────────── */
.post-footer { margin-top: 52px; padding-top: 36px; border-top: 1px solid var(--border); }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.post-tag-pill {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.post-tag-pill:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.post-author-box {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 12px;
}

.author-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  animation: avatarFloat 3s ease-in-out infinite;
}

.author-avatar-placeholder {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 600;
  flex-shrink: 0;
  animation: avatarFloat 3s ease-in-out infinite;
}

.author-name { font-size: 16px; font-weight: 600; color: var(--text); }
.author-bio { font-size: 14px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

/* ── POST NAV ────────────────────────────────────────────── */
.post-nav {
  display: flex;
  gap: 16px;
  margin-top: 44px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.post-nav-item {
  flex: 1;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s;
}
.post-nav-item:hover { border-color: var(--accent); }
.post-nav-next { text-align: right; }
.post-nav-label { font-size: 12px; color: var(--text-faint); }
.post-nav-title { font-size: 15px; font-weight: 500; color: var(--text); }

/* ── SCROLL TO TOP ───────────────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 40%, transparent);
}

.scroll-top.visible {
  pointer-events: auto;
}

.scroll-top:hover {
  opacity: 0.85;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 55%, transparent);
}

.scroll-top::before {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  border-left: 2.5px solid #fff;
  border-top: 2.5px solid #fff;
  transform: rotate(45deg) translate(1px, 2px);
}

/* ── GHOST IMAGE CARDS & CAPTIONS ───────────────────────── */
.kg-image-card {
  margin: 1.6em 0;
  text-align: center;
}

.kg-image-card img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.kg-image-card figcaption {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
  font-style: italic;
  line-height: 1.5;
}

/* ── ANIMATION ENHANCEMENTS ─────────────────────────────── */

/* 1. Staggered card reveal */
.latest-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.latest-card:nth-child(1) { transition-delay: 0s; }
.latest-card:nth-child(2) { transition-delay: 0.12s; }
.latest-card:nth-child(3) { transition-delay: 0.24s; }
.latest-card:nth-child(4) { transition-delay: 0.36s; }
.latest-card:nth-child(5) { transition-delay: 0.48s; }
.latest-card:nth-child(6) { transition-delay: 0.60s; }

/* Hover still lifts the card from its visible baseline */
.latest-card.visible:hover {
  transform: translateY(-6px);
}

/* 2. Button press effect */
.btn-primary:active,
.btn-secondary:active,
.subscribe-btn:active,
.nl-btn:active,
.view-all-btn:active {
  transform: scale(0.95);
  transition: transform 0.1s ease;
}

/* 3. Nav link underline animation */
.nav-links a {
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width 0.25s ease;
}
.nav-links a:hover::after {
  width: 100%;
}

/* 4. Article row hover slide */
.article-row {
  border-radius: 6px;
  transition: padding-left 0.2s ease, background 0.2s ease;
}
.article-row:hover {
  padding-left: 8px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

/* 5. Topic button press */
.topic-btn:active {
  transform: scale(0.98);
}

/* 6. Newsletter box scroll reveal */
.nl-box {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.nl-box.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 7. Scroll-top bounce */
@keyframes scrollTopBounce {
  0%   { opacity: 0; transform: translateY(20px) scale(0.8); }
  60%  { transform: translateY(-4px) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.scroll-top.visible {
  animation: scrollTopBounce 0.4s ease-out;
}

/* ── HERO SKILL TAGS ─────────────────────────────────────── */
.hero-skill-tags {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 10px;
  top: 50%;
  transform: translateY(-50%);
}
.hero-skill-tags.left  { right: calc(100% + 20px); }
.hero-skill-tags.right { left:  calc(100% + 20px); }

.skill-tag {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-muted);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 8%, transparent);
  animation: floatTag 3s ease-in-out infinite;
}
.skill-tag:nth-child(2) { animation-delay: 1s; }
.skill-tag:nth-child(3) { animation-delay: 2s; }
@keyframes floatTag {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-7px); }
}

/* ── HERO SCROLL INDICATOR ───────────────────────────────── */
.hero-scroll-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  pointer-events: none;
  animation: fadeIn 1s 2s ease both;
  opacity: 0;
}
.hero-scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, var(--text-faint), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(1.15); }
}
@keyframes fadeIn { to { opacity: 1; } }

/* ── TYPEWRITER ─────────────────────────────────────────── */
#heroTypewriter { color: var(--accent2); }
.tw-cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--accent2);
  margin-left: 3px;
  vertical-align: middle;
  border-radius: 1px;
  animation: twBlink 1s step-end infinite;
}
@keyframes twBlink { 50% { opacity: 0; } }

/* ── HERO AVATAR RING ────────────────────────────────────── */
.hero-photo-wrap {
  position: relative;
  flex-shrink: 0;
  z-index: 2;
}
.hero-photo-wrap::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) 0deg,
    color-mix(in srgb, var(--accent) 15%, transparent) 180deg,
    var(--accent) 360deg
  );
  animation: ringRotate 5s linear infinite;
  z-index: -1;
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), black calc(100% - 3px));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), black calc(100% - 3px));
}
@keyframes ringRotate { to { transform: rotate(360deg); } }

/* ── HERO STATS ──────────────────────────────────────────── */
.hero-stats {
  display: flex;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.stat-item {
  display: flex;
  flex-direction: column;
  padding-right: 24px;
}
.stat-row {
  display: flex;
  align-items: baseline;
  gap: 1px;
}
.stat-num {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-plus {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}
.stat-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
  margin-right: 24px;
  flex-shrink: 0;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hero { padding: 48px 32px; }
  .section { padding: 32px; }
  .latest-grid { grid-template-columns: 1fr 1fr; }
  .nl-wrap { padding: 32px; }
  .footer-top { padding: 40px 32px 32px; }
  .ft-divider { margin: 0 32px; }
  .footer-bottom { padding: 18px 32px; }
  .tag-header { padding: 40px 32px 24px; }
  .post-layout { grid-template-columns: 220px 1fr; gap: 24px; padding: 40px 24px 0; }
}

@media (max-width: 768px) {
  .navbar { padding: 14px 20px; }
  .nav-links { display: none; }
  .nav-logo { font-size: 18px; }
  .hero { grid-template-columns: 1fr; padding: 32px 20px; gap: 24px; justify-items: center; }
  .hero-photo { width: 120px; height: 120px; order: -1; }
  .hero-name { font-size: 34px; letter-spacing: -0.5px; }
  .hero-typewriter-line { font-size: 18px; }
  .hero-skill-tags { display: none; }
  .hero-scroll-hint { display: none; }
  .hero-desc { font-size: 15px; }
  .section { padding: 28px 20px; }
  .section-label { font-size: 18px; }
  .latest-grid { grid-template-columns: 1fr; }
  .card-title { font-size: 15px; }
  .explorer-new { grid-template-columns: 1fr; }
  .topic-cards { grid-template-columns: 1fr 1fr; }
  .topic-panel { border-top: 3px solid var(--accent); }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; padding: 32px 20px 24px; }
  .ft-divider { margin: 0 20px; }
  .footer-bottom { padding: 16px 20px; }
  .post-layout { display: block; padding: 0; }
  .post-sidebar { display: none; }
  .post-layout .post-container { padding: 36px 20px; }
  .post-container { padding: 36px 20px; }
  .post-title { font-size: 28px; }
  .page-hero { padding: 48px 20px 36px; }
  .page-title { font-size: 2rem; }
  .post-content { font-size: 16px; }
  .post-content p { font-size: 16px; }
  .post-content h2 { font-size: 22px; }
  .post-content h3 { font-size: 18px; }
  .nl-wrap { padding: 28px 20px; }
  .nl-box { flex-direction: column; padding: 24px; }
  .nl-form { width: 100%; }
  .nl-input { flex: 1; }
  .kg-width-wide { margin-left: 0; margin-right: 0; }
  .kg-width-full { margin-left: -20px; margin-right: -20px; }
  .tag-header { padding: 32px 20px 20px; }
  .tag-title { font-size: 24px; }
}
