/* ============================================================
   Clean & minimal theme
   ============================================================ */

:root {
  --ink:        #1a1a1a;
  --ink-soft:   #555;
  --ink-faint:  #888;
  --bg:         #ffffff;
  --bg-soft:    #fafafa;
  --line:       #e6e6e6;
  --accent:     #2d5be3;
  --accent-dim: #6b86d8;
  --maxw:       720px;
  --radius:     10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
               Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

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

h1, h2, h3 { line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1em 0.4em;
}

pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.55;
}
pre code { background: none; border: none; padding: 0; font-size: 1em; }

.skip-link {
  position: absolute; left: -9999px;
}
.skip-link:focus {
  left: 12px; top: 12px; background: var(--ink); color: #fff;
  padding: 8px 12px; border-radius: 6px; z-index: 10;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; gap: 16px; flex-wrap: wrap;
}
.brand {
  font-weight: 700; color: var(--ink); font-size: 1.05rem; letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.site-nav { display: flex; gap: 22px; }
.site-nav a {
  color: var(--ink-soft); font-size: 0.96rem; padding: 4px 0; position: relative;
}
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.site-nav a.active { color: var(--ink); font-weight: 600; }
.site-nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--accent); border-radius: 2px;
}

/* ---------- Main spacing ---------- */
main.wrap { padding-top: 56px; padding-bottom: 72px; min-height: 60vh; }

.section-title {
  font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-faint); font-weight: 600; margin: 0 0 18px;
}

/* ---------- Intro / About ---------- */
.intro { display: flex; align-items: center; gap: 28px; margin-bottom: 48px; }
.intro-photo {
  width: 150px; height: 150px; flex-shrink: 0;
  border-radius: 50%; object-fit: cover; object-position: 50% 22%;
  border: 1px solid var(--line);
}
.intro-text { min-width: 0; }
.intro-name { font-size: 2.5rem; margin: 0 0 8px; letter-spacing: -0.02em; }
.intro-tagline { font-size: 1.2rem; color: var(--ink-soft); margin: 0; }

.about { margin-bottom: 56px; }
.about p { margin: 0 0 18px; }
.about-list { margin: 0 0 18px; padding-left: 1.3em; }
.about-list li { margin: 7px 0; }
.about-subhead { font-size: 1.05rem; margin: 30px 0 10px; }

section + section { margin-top: 8px; }
.latest { margin-top: 12px; }

/* ---------- Page heads ---------- */
.page-head { margin-bottom: 36px; }
.page-head .section-title { margin-bottom: 10px; }
.page-lead { color: var(--ink-soft); margin: 0; font-size: 1rem; }

/* ---------- Projects ---------- */
.project-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; }
.project-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: var(--bg);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.project-card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 4px 18px rgba(45,91,227,0.08);
}
.project-top { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.project-name { font-size: 1.2rem; margin: 0; flex: 1; min-width: 0; }
.project-name a { color: var(--ink); }
.project-name a:hover { color: var(--accent); text-decoration: none; }
.project-top-right { display: flex; align-items: baseline; gap: 12px; flex-shrink: 0; white-space: nowrap; }
.project-date { color: var(--ink-faint); font-size: 0.82rem; }
.project-repo-link { color: var(--ink-faint); font-size: 1.1rem; }
.project-repo-link:hover { color: var(--accent); text-decoration: none; }
.project-desc { color: var(--ink-soft); margin: 10px 0 0; font-size: 0.98rem; }
.project-tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  display: inline-block;
  font-size: 0.74rem; letter-spacing: 0.02em;
  color: var(--ink-soft); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 10px; margin-right: 4px;
}

/* ---------- Article list ---------- */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-item {
  display: grid; grid-template-columns: 120px 1fr; gap: 18px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.post-item:first-child { border-top: 1px solid var(--line); }
.post-date { color: var(--ink-faint); font-size: 0.9rem; padding-top: 3px; }
.post-link { font-size: 1.18rem; font-weight: 600; color: var(--ink); }
.post-link:hover { color: var(--accent); text-decoration: none; }
.post-excerpt { color: var(--ink-soft); margin: 8px 0 0; font-size: 0.97rem; }
.post-tags { margin-top: 12px; }

.post-list.compact { margin-bottom: 14px; }
.post-list.compact li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.post-list.compact .post-link { font-size: 1.02rem; font-weight: 500; }
.post-list.compact .post-date { padding-top: 0; white-space: nowrap; }

/* ---------- Single post ---------- */
.post-header { margin-bottom: 32px; }
.post .back { margin: 0 0 18px; font-size: 0.92rem; }
.post-title { font-size: 2rem; margin: 0 0 12px; letter-spacing: -0.02em; }
.post-meta { color: var(--ink-faint); font-size: 0.92rem; margin: 0; }
.post-meta .dot { margin: 0 8px; }

.post-body { font-size: 1.05rem; }
.post-body h2 { font-size: 1.45rem; margin: 40px 0 14px; }
.post-body h3 { font-size: 1.2rem; margin: 30px 0 10px; }
.post-body p { margin: 0 0 20px; }
.post-body ul, .post-body ol { margin: 0 0 20px; padding-left: 1.4em; }
.post-body li { margin: 6px 0; }
.post-body blockquote {
  margin: 0 0 20px; padding: 4px 18px; border-left: 3px solid var(--accent-dim);
  color: var(--ink-soft); font-style: italic;
}
.post-body img { max-width: 100%; height: auto; border-radius: var(--radius); }
.post-body hr { border: none; border-top: 1px solid var(--line); margin: 36px 0; }
.post-footer { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.95rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; margin-top: 40px; }
.footer-inner { display: flex; flex-direction: column; gap: 8px; }
.social { display: flex; flex-wrap: wrap; gap: 18px; }
.social a { color: var(--ink-soft); font-size: 0.92rem; }
.social a:hover { color: var(--accent); }
.copyright { color: var(--ink-faint); font-size: 0.85rem; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  body { font-size: 17px; }
  .intro { flex-direction: column; align-items: flex-start; gap: 18px; }
  .intro-photo { width: 120px; height: 120px; }
  .intro-name { font-size: 2rem; }
  .post-item { grid-template-columns: 1fr; gap: 6px; }
  .post-date { padding-top: 0; }
  main.wrap { padding-top: 40px; }
  .project-top { flex-wrap: wrap; gap: 4px 12px; }
  .project-top-right { width: 100%; }
}
