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

:root {
  --bg: #FAFAFA;
  --text: #1a1a1a;
  --muted: #6b7280;
  --link: #1a1a1a;
  --max: 680px;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── NAV ── */
header {
  padding: 1.4rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.site-name {
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.01em;
}

nav {
  display: flex;
  gap: 2rem;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 0.15s;
}

nav a:hover { color: var(--text); }

/* ── MAIN ── */
main {
  flex: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  width: 100%;
}

/* ── INDEX HERO ── */
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero .tagline {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 1.4rem;
}

.hero .bio {
  color: var(--text);
  font-size: 1rem;
  max-width: 520px;
  margin-bottom: 1.4rem;
  line-height: 1.7;
}

.hero a.email-link {
  color: var(--text);
  font-size: 1rem;
  text-underline-offset: 3px;
}

/* ── LATEST POST STRIP ── */
.latest-post {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid #e0e0dc;
}

.latest-post .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.latest-post a {
  text-decoration: none;
  color: var(--text);
  display: block;
}

.latest-post .post-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.latest-post .post-date {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── POSTS LIST PAGE ── */
.page-heading {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-list li {
  border-top: 1px solid #e0e0dc;
  padding: 1.1rem 0;
}

.post-list li:last-child {
  border-bottom: 1px solid #e0e0dc;
}

.post-list a {
  text-decoration: none;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.post-list a:hover .post-list-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-list-title {
  font-size: 0.97rem;
  font-weight: 500;
}

.post-list-date {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── SINGLE POST ── */
.post-header {
  margin-bottom: 2.5rem;
}

.post-header h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.post-header .post-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.post-body {
  font-size: 1rem;
  line-height: 1.8;
  color: #2d2d2d;
}

.post-body p { margin-bottom: 1.4em; }
.post-body h2 { font-size: 1.15rem; font-weight: 700; margin: 2em 0 0.6em; letter-spacing: -0.01em; }
.post-body h3 { font-size: 1rem; font-weight: 700; margin: 1.6em 0 0.4em; }
.post-body ul, .post-body ol { padding-left: 1.4em; margin-bottom: 1.4em; }
.post-body li { margin-bottom: 0.3em; }
.post-body a { color: var(--text); text-underline-offset: 3px; }
.post-body code {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.88em;
  background: #e8e8e6;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
.post-body pre {
  background: #e8e8e6;
  border-radius: 6px;
  padding: 1.2em 1.4em;
  overflow-x: auto;
  margin-bottom: 1.4em;
}
.post-body pre code { background: none; padding: 0; }

.back-link {
  display: inline-block;
  margin-top: 3rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  text-underline-offset: 3px;
}
.back-link:hover { text-decoration: underline; color: var(--text); }

/* ── ABOUT / STATIC PAGES ── */
.static-page h1 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.static-page p {
  font-size: 1rem;
  line-height: 1.8;
  color: #2d2d2d;
  margin-bottom: 1.2em;
  max-width: 520px;
}

.static-page a {
  color: var(--text);
  text-underline-offset: 3px;
}

/* ── FOOTER ── */
footer {
  padding: 1.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 520px) {
  header { padding: 1.2rem 1.2rem; }
  main   { padding: 2.5rem 1.2rem 5rem; }
  footer { padding: 1.2rem 1.2rem; }
  .post-list a { flex-direction: column; gap: 0.1rem; }
}
