/* MoE post — scoped under .moe-post to avoid Chirpy / Bootstrap conflicts */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;700;900&family=JetBrains+Mono:wght@400;700&family=Noto+Sans+KR:wght@300;400;500&display=swap');

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

@keyframes moe-scrollPulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1; }
}

/* ── ROOT SCOPE ── */
.moe-post {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a28;
  --accent: #7c6cfc;
  --accent2: #fc6c8f;
  --accent3: #6cfcbc;
  --text: #e8e8f0;
  --text-muted: #8888aa;
  --border: #2a2a40;
  --code-bg: #0d0d18;

  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 300;
  line-height: 1.8;
  overflow-x: hidden;
  /* bleed past post-content padding */
  margin-left: -1.5rem;
  margin-right: -1.5rem;
  margin-top: -1rem;
  padding: 0;
}

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

/* ── HERO ── */
.moe-post .hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 6rem 8vw;
  position: relative;
  overflow: hidden;
}

.moe-post .hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(124,108,252,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(252,108,143,0.10) 0%, transparent 60%);
  pointer-events: none;
}

.moe-post .hero-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 2rem !important;
  opacity: 0;
  animation: moe-fadeUp 0.6s 0.2s forwards;
}

.moe-post .hero h1 {
  font-family: 'Noto Serif KR', serif !important;
  font-size: clamp(2.4rem, 6vw, 5rem) !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
  max-width: 780px;
  margin-bottom: 1.5rem !important;
  opacity: 0;
  animation: moe-fadeUp 0.6s 0.4s forwards;
  border: none !important;
  padding-bottom: 0 !important;
}

.moe-post .hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.moe-post .hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  opacity: 0;
  animation: moe-fadeUp 0.6s 0.6s forwards;
  margin: 0 !important;
}

.moe-post .hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  opacity: 0;
  animation: moe-fadeUp 0.6s 1s forwards;
}

.moe-post .scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: moe-scrollPulse 2s ease-in-out infinite;
}

/* ── LAYOUT ── */
.moe-post .container {
  max-width: 820px !important;
  margin: 0 auto !important;
  padding: 0 2rem !important;
  width: 100% !important;
}

.moe-post section {
  padding: 5rem 0 !important;
  border-bottom: 1px solid var(--border) !important;
  border-top: none !important;
  margin: 0 !important;
}

.moe-post section:last-child { border-bottom: none !important; }

.moe-post .section-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 1rem !important;
}

.moe-post h2 {
  font-family: 'Noto Serif KR', serif !important;
  font-size: clamp(1.6rem, 3vw, 2.2rem) !important;
  font-weight: 700 !important;
  margin-bottom: 1.5rem !important;
  line-height: 1.3 !important;
  color: var(--text) !important;
  border: none !important;
  padding: 0 !important;
}

.moe-post h3 {
  font-family: 'Noto Serif KR', serif !important;
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  margin: 2.5rem 0 1rem !important;
  color: var(--text) !important;
}

.moe-post p {
  margin-bottom: 1.2rem !important;
  color: #c8c8e0;
}

.moe-post strong { color: var(--text); font-weight: 500; }

.moe-post .highlight {
  color: var(--accent);
  font-weight: 500;
}

/* ── CALLOUT ── */
.moe-post .callout {
  border-left: 3px solid var(--accent) !important;
  background: rgba(124,108,252,0.06);
  padding: 1.2rem 1.5rem !important;
  margin: 2rem 0 !important;
  border-radius: 0 8px 8px 0;
  border-right: none;
  border-top: none;
  border-bottom: none;
}

.moe-post .callout.pink {
  border-color: var(--accent2) !important;
  background: rgba(252,108,143,0.06);
}

.moe-post .callout.green {
  border-color: var(--accent3) !important;
  background: rgba(108,252,188,0.06);
}

.moe-post .callout p { margin: 0 !important; }

/* ── MATH BLOCK ── */
.moe-post .math-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem 2rem !important;
  margin: 1.5rem 0 !important;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  color: #d0d8f0;
  line-height: 2;
}

/* ── SVG FIGURES ── */
.moe-post .figure {
  margin: 2.5rem 0 !important;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.moe-post .figure-caption {
  text-align: center;
  padding: 0.8rem 1rem !important;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
}

.moe-post .figure svg {
  display: block;
  width: 100%;
}

/* ── TABLE ── */
.moe-post .table-wrap {
  overflow-x: auto;
  margin: 2rem 0 !important;
}

.moe-post table {
  width: 100%;
  border-collapse: collapse !important;
  font-size: 0.88rem;
}

.moe-post th {
  background: var(--surface2) !important;
  color: var(--accent) !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  padding: 0.8rem 1rem !important;
  text-align: left !important;
  border-bottom: 1px solid var(--border) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
}

.moe-post td {
  padding: 0.75rem 1rem !important;
  border-bottom: 1px solid var(--border) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  color: #c0c0d8;
}

.moe-post tr:last-child td { border-bottom: none !important; }
.moe-post tr:hover td { background: rgba(124,108,252,0.04); }
.moe-post tr:nth-child(even) td { background: transparent !important; }

.moe-post td.highlight-cell {
  color: var(--accent3) !important;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
}

/* ── GRID CARDS ── */
.moe-post .card-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2rem 0 !important;
}

.moe-post .card {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 10px !important;
  padding: 1.4rem !important;
  transition: border-color 0.2s, transform 0.2s;
}

.moe-post .card:hover {
  border-color: var(--accent) !important;
  transform: translateY(-2px);
}

.moe-post .card-icon {
  font-size: 1.6rem;
  margin-bottom: 0.8rem !important;
}

.moe-post .card h4 {
  font-size: 0.9rem !important;
  font-weight: 500 !important;
  margin-bottom: 0.5rem !important;
  color: var(--text) !important;
}

.moe-post .card p {
  font-size: 0.82rem !important;
  color: var(--text-muted) !important;
  margin: 0 !important;
  line-height: 1.6;
}

/* ── COMPARE ── */
.moe-post .compare {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0 !important;
}

.moe-post .compare-box {
  background: var(--surface);
  border: 1px solid var(--border) !important;
  border-radius: 10px;
  padding: 1.4rem !important;
}

.moe-post .compare-box.bad { border-color: rgba(252,108,143,0.4) !important; }
.moe-post .compare-box.good { border-color: rgba(108,252,188,0.4) !important; }

.moe-post .compare-box h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem !important;
  letter-spacing: 0.12em;
  margin-bottom: 1rem !important;
}

.moe-post .compare-box.bad h4 { color: var(--accent2) !important; }
.moe-post .compare-box.good h4 { color: var(--accent3) !important; }

/* ── REVEAL ANIMATION ── */
.moe-post .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.moe-post .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── INLINE EQ ── */
.moe-post .eq {
  display: inline-block;
  background: rgba(124,108,252,0.12);
  border-radius: 4px;
  padding: 0.1em 0.5em !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  color: #c8d4f8;
}

/* ── POST FOOTER ── */
.moe-post footer {
  text-align: center !important;
  padding: 4rem 2rem !important;
  color: var(--text-muted) !important;
  font-size: 0.82rem;
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg);
}
