@font-face { font-family: 'Akkurat'; src: url('/assets/akkurat.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Akkurat'; src: url('/assets/akkurat.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Akkurat'; src: url('/assets/akkurat.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Akkurat'; src: url('/assets/akkurat.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

::selection { background: #b8d4ac; color: #203B14; }
::-moz-selection { background: #b8d4ac; color: #203B14; }

/* Both nav and scroll-wrap pinned to viewport — html/body never scroll */
html, body { overflow: hidden; }
.scroll-wrap { position: fixed; top: 56px; left: 0; right: 0; bottom: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d0d0d0 transparent; }
.scroll-wrap::-webkit-scrollbar { width: 6px; }
.scroll-wrap::-webkit-scrollbar-track { background: transparent; }
.scroll-wrap::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }
.scroll-wrap::-webkit-scrollbar-thumb:hover { background: #a0a0a0; }
.scroll-wrap::-webkit-scrollbar-thumb:active { background: #888888; }
.scroll-wrap::-webkit-scrollbar-corner { background: transparent; }

:root {
  --bg: #FBFDF6;
  --surface: #ffffff;
  --surface-hover: #ECF2DF;
  --border: #ECF2DF;
  --text: #203B14;
  --text-secondary: #6B7860;
  --text-tertiary: #718465;
  --accent: #2E4722;
  --accent-soft: #ECF2DF;
  --radius-sm: 6px;
  --radius: 10px;
}

html {
  font-size: 18px;
  font-family: 'Akkurat', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; }

/* ===== Navigation ===== */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: rgba(251,253,246,0.85); backdrop-filter: blur(16px); }
.nav-inner { padding: 0 56px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-size: 15px; font-weight: 600; }
.nav-links { display: flex; gap: 2px; }
.nav-link { font-size: 14px; font-weight: 500; color: var(--text-tertiary); padding: 6px 12px; border-radius: var(--radius-sm); }
.nav-link.active { color: var(--text); background: var(--accent-soft); }

/* ===== Layout ===== */
.view { padding: 48px 56px 80px; }

/* ===== Home ===== */
.home-hero { padding: 56px 0 24px; }
.home-hero h1 { font-size: 48px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.05; margin-bottom: 18px; }
.home-hero h1 .accent { color: var(--accent); }
.home-hero p { font-size: 18px; color: var(--text-secondary); line-height: 1.6; max-width: 480px; }
.home-divider { border: none; border-top: 1px dashed var(--text-tertiary); margin: 48px -56px; }
.home-meta { display: flex; gap: 48px; flex-wrap: wrap; }
.home-meta-item { display: flex; flex-direction: column; gap: 4px; }
.home-meta-item .label { font-size: 12px; font-weight: 500; color: var(--text-tertiary); }
.home-meta-item .value { font-size: 15px; font-weight: 500; }

/* ===== Article List ===== */
.article-list-header { margin-bottom: 32px; }

/* Tag bar */
.tag-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 32px; }
.tag-pill { font-size: 12px; font-weight: 500; color: var(--text-tertiary); border: 1px solid var(--border); background: transparent; padding: 5px 14px; border-radius: 20px; cursor: pointer; }
.tag-pill:hover { background: var(--surface-hover); color: var(--text-secondary); }
.tag-pill.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.tag-pill .cnt { font-weight: 400; margin-left: 2px; opacity: 0.7; }

/* Card group — dashed divider lines edge-to-edge */
.card-group { border-top: 1px dashed var(--text-tertiary); }

.card {
  display: block; color: inherit; cursor: pointer;
  padding: 24px 0; border-bottom: 1px dashed var(--text-tertiary);
  background: transparent; margin: 0; border-left: 0; border-right: 0;
}
.card:hover { background: var(--surface-hover); }

.card-title { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.card-date { font-size: 13px; color: var(--text-tertiary); margin-bottom: 8px; }
.card-tag { display: inline-block; font-size: 11px; font-weight: 500; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 3px; }

/* ===== Article Detail ===== */
.article-detail { padding-top: 20px; }

.breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; font-size: 13px; color: var(--text-tertiary); }
.breadcrumb a { color: var(--text-tertiary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { opacity: 0.5; }

.article-detail h1 { font-size: 52px; font-weight: 600; letter-spacing: -0.04em; line-height: 1.08; margin-bottom: 16px; }

.detail-subtitle { font-size: 16px; color: var(--text-secondary); line-height: 1.6; }

.detail-meta { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; font-size: 13px; color: var(--text-tertiary); }
.detail-meta .detail-tag { font-size: 11px; font-weight: 500; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 3px; }

.article-divider { border: none; border-top: 1px dashed var(--text-tertiary); margin: 24px -56px 36px; }

/* ===== Markdown Content ===== */
.md-content {
  font-size: 17px; line-height: 1.7; color: var(--text);
  margin: 0 auto; max-width: 760px;
}
.md-content h1 { font-size: 28px; font-weight: 600; margin: 44px 0 14px; line-height: 1.3; }
.md-content h1:first-child { margin-top: 0; }
.md-content h2 { font-size: 22px; font-weight: 600; margin: 36px 0 12px; line-height: 1.3; }
.md-content h3 { font-size: 17px; font-weight: 600; margin: 28px 0 8px; line-height: 1.3; }
.md-content p { margin-bottom: 20px; }
.md-content ul, .md-content ol { margin-bottom: 20px; padding-left: 24px; }
.md-content li { margin-bottom: 6px; }
.md-content code {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.85em; font-weight: 400;
  color: #0a3069;
  background: #f3f3f3; padding: 2px 6px; border-radius: 4px;
}
.md-content pre code { background: none; color: #1f1f1f; padding: 0; }

/* Code blocks — light theme */
.md-content pre {
  background: #fafafa !important; border: 1px solid #e5e5e5;
  border-radius: 8px; margin-bottom: 20px;
  position: relative;
  padding: 0;
}
.md-content pre > code { display: block; padding: 14px 18px 16px; }

.md-content pre code {
  display: block;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.6;
  color: #1f1f1f;
  background: transparent; padding: 14px 18px 16px; overflow-x: auto;
  tab-size: 4;
  border-radius: 0 0 8px 8px;
}

.code-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 32px; padding: 0 12px;
  border-bottom: 1px solid #e5e5e5;
  background: #f3f3f3;
  border-radius: 8px 8px 0 0;
}

.code-lang-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase;
  color: #6b6b6b;
}

.code-copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
  color: #4a4a4a;
  background: transparent; border: none;
  cursor: pointer; padding: 4px; border-radius: 4px;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.code-copy-btn:hover { color: #203B14; background: rgba(32, 59, 20, 0.06); }
.code-copy-btn:active { background: rgba(32, 59, 20, 0.12); }
.code-copy-btn.copied { color: #2E4722; }

.code-copy-btn svg { width: 14px; height: 14px; flex-shrink: 0; display: block; pointer-events: none; }

/* Light-theme syntax highlight (GitHub-style) */
.hl-kw       { color: #cf222e; font-weight: 500; }
.hl-str      { color: #0a3069; }
.hl-cm       { color: #6e7781; font-style: italic; }
.hl-num      { color: #0550ae; }
.hl-fn       { color: #8250df; }
.hl-prop     { color: #953800; }
.hl-ps       { color: #953800; }
.hl-builtin  { color: #0550ae; }
.hl-deco     { color: #8250df; }
.hl-tag      { color: #116329; font-weight: 500; }
.hl-attr     { color: #0550ae; }
.hl-cmtag    { color: #6e7781; }

.md-content blockquote { border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; margin: 24px 0; color: var(--text-secondary); }
.md-content a { text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.md-content a:hover { text-decoration-color: var(--accent); color: var(--accent); }
.md-content img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.md-content hr { border: none; border-top: 1px dashed var(--text-tertiary); margin: 36px 0; }
.md-content strong { font-weight: 600; }

/* ===== Project Page ===== */
.project-header { margin-bottom: 32px; }
.project-list { border-top: 1px dashed var(--text-tertiary); }
.project-card { padding: 28px 0; border-bottom: 1px dashed var(--text-tertiary); background: transparent; margin: 0; border-left: 0; border-right: 0; }
.project-card:hover { background: var(--surface-hover); }
.project-card .card-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.project-card .card-desc { font-size: 14px; color: var(--text-secondary); margin-top: 8px; line-height: 1.6; }
.project-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.project-tag { font-size: 11px; font-weight: 500; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 4px; }

/* ===== About Page ===== */
.about-content { padding-top: 56px; }
.about-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 600; color: #fff; margin-bottom: 24px; }
.about-content h1 { font-size: 36px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 10px; }
.about-content .about-tagline { font-size: 14px; color: var(--text-tertiary); margin-bottom: 40px; }
.about-bio { font-size: 16px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 48px; max-width: 500px; }
.about-section { border-top: 1px dashed var(--text-tertiary); padding: 24px 0; display: flex; gap: 24px; }
.about-section-label { font-size: 12px; font-weight: 500; color: var(--text-tertiary); width: 100px; flex-shrink: 0; padding-top: 2px; }
.about-section-content { font-size: 15px; line-height: 1.7; color: var(--text); flex: 1; }
.about-section-content .tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.about-section-content .tag-list span { font-size: 12px; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 4px; }

/* ===== Footer ===== */
.footer { border-top: 1px dashed var(--text-tertiary); }
.footer-inner { padding: 20px 56px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-tertiary); }

/* ===== Empty / Loading ===== */
.empty-state { padding: 60px 0; }
.empty-state h2 { font-size: 18px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.loading-state { font-size: 13px; color: var(--text-tertiary); padding: 40px 0; }

/* Disable card hover background on touch / mobile devices */
@media (hover: hover) {
  .card:hover { background: var(--surface-hover); }
  .project-card:hover { background: var(--surface-hover); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-inner { padding: 0 24px; }
  .view { padding: 36px 24px 56px; }
  .home-hero h1 { font-size: 36px; }
  .article-detail h1 { font-size: 36px; width: auto; }
  .home-divider { margin: 40px -24px; }
  .article-divider { margin: 24px -24px 36px; }
  .md-content { max-width: none; }
  .md-content hr { margin: 32px -24px; }
  .card-group { border-top: 1px dashed var(--text-tertiary); margin: 0; }
  .about-section { flex-direction: column; gap: 12px; }
  .about-section-label { width: auto; }
  .footer-inner { padding: 18px 24px; flex-direction: column; gap: 6px; text-align: center; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 0 16px; }
  .view { padding: 28px 16px 48px; }
  html { font-size: 16px; }
  .nav-link { font-size: 13px; padding: 4px 8px; }
  .home-hero h1 { font-size: 30px; }
  .article-detail h1 { font-size: 28px; }
  .home-divider { margin: 32px -16px; }
  .article-divider { margin: 20px -16px 28px; }
  .md-content { max-width: none; }
  .md-content hr { margin: 28px -16px; }
  .home-meta { flex-direction: column; gap: 16px; }
  .footer-inner { padding: 16px; }
}
