/* ====== Fonts ====== */
@font-face {
  font-family: 'Pretendard';
  font-weight: 400; font-style: normal; font-display: swap;
  src: url('https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/static/woff2/Pretendard-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Pretendard';
  font-weight: 500; font-style: normal; font-display: swap;
  src: url('https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/static/woff2/Pretendard-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Pretendard';
  font-weight: 600; font-style: normal; font-display: swap;
  src: url('https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/static/woff2/Pretendard-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Pretendard';
  font-weight: 700; font-style: normal; font-display: swap;
  src: url('https://cdn.jsdelivr.net/npm/pretendard@1.3.9/dist/web/static/woff2/Pretendard-Bold.woff2') format('woff2');
}

/* ====== Design Tokens ====== */
:root {
  --bg:           #f3ede4;   /* warm parchment */
  --surface:      #eae0d4;   /* slightly deeper warm */
  --border:       #d6c4b0;   /* warm tan border */
  --text:         #2a180a;   /* Pantone Coffee Bean */
  --muted:        #7c604e;   /* mid-tone coffee */
  --accent:       #245e97;   /* Blue Frost — darkened for WCAG AA (5.6:1) */
  --accent-light: #d6eef9;   /* Blue Frost tint */

  --radius: 8px;
  --t:      160ms ease;

  --max-w:     1040px;
  --max-prose:  720px;
}

/* ====== Reset ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a    { color: inherit; text-decoration: none; }

/* ====== Layout ====== */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ====== Header ====== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(243, 237, 228, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  transition: color var(--t);
}
.logo:hover { color: var(--accent); }

.nav { display: flex; gap: 28px; }
.nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--t);
}
.nav a:hover,
.nav a.active { color: var(--text); }

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: all var(--t);
  border: 1px solid transparent;
}
.btn-primary  { background: var(--text); color: #fff; border-color: var(--text); }
.btn-primary:hover  { background: #4a2e1a; }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: #9ca3af; background: var(--surface); }

/* ====== Tags ====== */
.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-light);
  color: #245e97;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tag-oss    { background: #f0fdf4; color: #15803d; }
.tag-career { background: #fff7ed; color: #c2410c; }
.tag-deep   { background: #faf5ff; color: #7c3aed; }

/* ====== Hero (index) ====== */
.hero {
  padding: 96px 0 80px;
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 16px;
}
.hero-title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.hero-desc {
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 500px;
  margin-bottom: 36px;
}

/* ====== Recent Posts (index) ====== */
.posts-section { padding: 80px 0; }
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 36px;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.text-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  transition: opacity var(--t);
}
.text-link:hover { opacity: 0.7; }

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.post-card {
  display: block;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--t), transform var(--t), box-shadow var(--t);
}
.post-card:hover {
  border-color: #d1d5db;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
.post-card .tag     { margin-bottom: 16px; }
.post-card-title    { font-size: 16px; font-weight: 600; line-height: 1.45; letter-spacing: -0.01em; margin-bottom: 10px; }
.post-card-excerpt  { font-size: 14px; line-height: 1.65; color: var(--muted); margin-bottom: 20px; }
.post-meta          { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.post-meta .sep     { opacity: 0.5; }

/* ====== Blog List Page ====== */
.page-hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
}
.page-title {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.page-desc { font-size: 16px; color: var(--muted); line-height: 1.6; }

.posts-list-section { padding: 48px 0 96px; }
.posts-list         { display: flex; flex-direction: column; }

.post-list-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.post-list-item:first-child           { border-top: 1px solid var(--border); }
.post-list-item:hover .post-list-title { color: var(--accent); }

.post-list-date    { font-size: 13px; color: var(--muted); padding-top: 3px; white-space: nowrap; }
.post-list-content { display: flex; flex-direction: column; gap: 8px; }
.post-list-tags    { display: flex; gap: 6px; flex-wrap: wrap; }
.post-list-title   { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.4; color: var(--text); transition: color var(--t); }
.post-list-excerpt { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* ====== Post Page ====== */
.post-header {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 72px 24px 40px;
}
.post-header .tag  { margin-bottom: 20px; }
.post-title-main   { font-size: clamp(26px, 4vw, 38px); font-weight: 700; line-height: 1.2; letter-spacing: -0.03em; margin-bottom: 20px; }
.post-info         { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.post-author       { font-weight: 500; color: var(--text); }

.post-divider {
  border: none;
  border-top: 1px solid var(--border);
  max-width: var(--max-prose);
  margin: 0 auto;
}

/* ====== Prose ====== */
.prose { max-width: var(--max-prose); margin: 0 auto; padding: 48px 24px 96px; }

.prose h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 52px 0 16px; line-height: 1.3; }
.prose h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin: 36px 0 12px; line-height: 1.4; }

.prose p            { font-size: 16px; line-height: 1.8; color: #374151; margin-bottom: 20px; }
.prose a            { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; transition: opacity var(--t); }
.prose a:hover      { opacity: 0.75; }
.prose strong       { font-weight: 600; color: var(--text); }
.prose em           { font-style: italic; }

.prose code {
  font-family: 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Menlo', monospace;
  font-size: 13.5px;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.prose pre {
  background: #1e1e2e;
  border-radius: var(--radius);
  padding: 24px;
  overflow-x: auto;
  margin: 28px 0;
}
.prose pre code {
  background: none;
  border: none;
  color: #cdd6f4;
  font-size: 14px;
  padding: 0;
  line-height: 1.7;
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 20px;
  margin: 28px 0;
  color: var(--muted);
  font-style: italic;
}
.prose ul, .prose ol { padding-left: 24px; margin-bottom: 20px; }
.prose li            { font-size: 16px; line-height: 1.8; color: #374151; margin-bottom: 6px; }
.prose hr            { border: none; border-top: 1px solid var(--border); margin: 48px 0; }
.prose img           { width: 100%; border-radius: var(--radius); margin: 28px 0; border: 1px solid var(--border); }

/* ====== About Page ====== */
.about-section { max-width: 640px; margin: 0 auto; padding: 80px 24px 96px; }
.about-intro   { display: flex; align-items: center; gap: 28px; margin-bottom: 44px; }

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.about-name  { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.about-role  { font-size: 15px; color: var(--muted); }

.about-body p      { font-size: 16px; line-height: 1.8; color: #374151; margin-bottom: 20px; }
.about-body strong { font-weight: 600; color: var(--text); }
.about-links       { display: flex; gap: 10px; margin-top: 36px; flex-wrap: wrap; }

/* ====== Footer ====== */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; margin-top: auto; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-name      { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
.footer-links     { display: flex; gap: 20px; }
.footer-links a   { font-size: 14px; color: var(--muted); transition: color var(--t); }
.footer-links a:hover { color: var(--text); }
.footer-copy      { font-size: 13px; color: var(--muted); }

/* ====== 404 ====== */
.not-found {
  max-width: 480px;
  margin: 0 auto;
  padding: 120px 24px;
  text-align: center;
}
.not-found-code  { font-size: 80px; font-weight: 700; color: var(--border); letter-spacing: -0.04em; line-height: 1; margin-bottom: 16px; }
.not-found-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
.not-found-desc  { font-size: 16px; color: var(--muted); line-height: 1.6; margin-bottom: 36px; }
.not-found-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

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

/* Hero — 자식 요소 순차 등장 */
.hero .container > * {
  opacity: 0;
  animation: fadeUp 600ms ease forwards;
}
.hero .container > *:nth-child(1) { animation-delay:   0ms; }
.hero .container > *:nth-child(2) { animation-delay: 150ms; }
.hero .container > *:nth-child(3) { animation-delay: 280ms; }
.hero .container > *:nth-child(4) { animation-delay: 400ms; }

/* 스크롤 진입 fade-in */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 300ms ease, transform 300ms ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ====== Responsive ====== */
@media (max-width: 640px) {
  .hero         { padding: 64px 0 52px; }
  .posts-grid   { grid-template-columns: 1fr; }

  .post-list-item { grid-template-columns: 1fr; gap: 6px; }
  .post-list-date { padding-top: 0; }

  .footer-inner   { flex-direction: column; align-items: flex-start; gap: 12px; }
  .about-intro    { flex-direction: column; align-items: flex-start; gap: 20px; }
}
