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

:root {
  --ink: #1a1a18;
  --ink-2: #555550;
  --ink-3: #999992;
  --rule: #e8e8e3;
  --bg: #faf9f7;
  --accent: #2b5ce6;
  --accent-hover: #1a3fa8;

  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, sans-serif;

  --max-w: 680px;
  --nav-h: 56px;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--accent-hover); }

/* ─────────────────────────────────────────
   Nav
──────────────────────────────────────────*/
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.2rem, 5vw, 2.5rem);
}

.nav-logo {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.nav-logo:hover { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 1.8rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}
.nav-links a.active {
  font-weight: 500;
}

/* ─────────────────────────────────────────
   Main layout
──────────────────────────────────────────*/
main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5rem) clamp(1.2rem, 5vw, 0rem);
}

/* ─────────────────────────────────────────
   About page
──────────────────────────────────────────*/
.about-hero {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
}

.about-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

.tagline {
  font-size: 0.95rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 400;
}

.about-body {
  margin-bottom: 3rem;
}

.about-body p {
  margin-bottom: 1.1rem;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink);
}

.about-body strong { font-weight: 500; }

.links-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.links-row a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ink-2);
}
.links-row a:hover { color: var(--accent); }

/* ─────────────────────────────────────────
   Post list (shared)
──────────────────────────────────────────*/
.recent-writing h2,
.page-blog h1,
.page-projects h1,
.page-post .post-header h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.recent-writing h2 {
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
  color: var(--ink-3);
  font-family: var(--font-sans);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

.post-list {
  list-style: none;
  border-top: 1px solid var(--rule);
}

.post-list li {
  border-bottom: 1px solid var(--rule);
}

.post-list li a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.1s;
}
.post-list li a:hover .post-title {
  color: var(--accent);
}

.post-title {
  font-size: 1rem;
  font-weight: 400;
  font-family: var(--font-serif);
  flex: 1;
}

.post-meta {
  font-size: 0.8rem;
  color: var(--ink-3);
  white-space: nowrap;
  flex-shrink: 0;
}

.see-all {
  display: inline-block;
  margin-top: 1.2rem;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.see-all:hover { color: var(--accent); }

/* ─────────────────────────────────────────
   Blog listing page
──────────────────────────────────────────*/
.page-blog h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 0.6rem;
}

.page-subtitle {
  color: var(--ink-3);
  font-size: 0.975rem;
  margin-bottom: 2.5rem;
}

.post-list--full li a {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  padding: 1.1rem 0;
}

.post-list--full .post-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.post-excerpt {
  font-size: 0.9rem;
  color: var(--ink-2);
  line-height: 1.5;
  font-family: var(--font-sans);
}

/* ─────────────────────────────────────────
   Projects page
──────────────────────────────────────────*/
.page-projects h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin-bottom: 0.6rem;
}

.project-list {
  list-style: none;
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--rule);
}

.project-card {
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--rule);
}

.project-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.project-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
}

.project-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--ink-3);
  background: var(--rule);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.project-desc {
  font-size: 0.95rem;
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: 0.8rem;
  max-width: 560px;
}

.project-links {
  display: flex;
  gap: 1.2rem;
}

.project-links a {
  font-size: 0.875rem;
  color: var(--ink-2);
}
.project-links a:hover { color: var(--accent); }

/* ─────────────────────────────────────────
   Blog post page
──────────────────────────────────────────*/
.page-post {
  max-width: var(--max-w);
}

.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.post-header h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  line-height: 1.2;
  margin-bottom: 0.8rem;
}

.post-byline {
  font-size: 0.875rem;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dot { opacity: 0.4; }

.post-content {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.82;
  color: var(--ink);
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content h2 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-top: 2.8rem;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.post-content h3 {
  font-size: 1.05rem;
  font-weight: 500;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.post-content em {
  font-style: italic;
}

.post-content strong {
  font-weight: 600;
}

.post-content blockquote {
  border-left: 2px solid var(--rule);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  color: var(--ink-2);
  font-style: italic;
}

.post-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--rule);
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

.post-content pre {
  background: var(--ink);
  color: #e8e8e3;
  padding: 1.2rem 1.4rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.post-content pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

.post-nav {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.post-nav a {
  font-size: 0.875rem;
  color: var(--ink-2);
}
.post-nav a:hover { color: var(--accent); }

/* ─────────────────────────────────────────
   Footer
──────────────────────────────────────────*/
footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem clamp(1.2rem, 5vw, 2.5rem);
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-3);
  margin-top: auto;
}

/* ─────────────────────────────────────────
   Post category & lede
──────────────────────────────────────────*/
.post-category {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-family: var(--font-sans);
  margin-bottom: 0.7rem;
}

.post-category-inline {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-family: var(--font-sans);
  display: block;
  margin-bottom: 0.2rem;
}

.post-lede {
  font-size: 1.1rem;
  color: var(--ink-2);
  font-style: italic;
  border-left: 2px solid var(--rule);
  padding-left: 1.2rem;
  margin-bottom: 2rem;
}

.todo {
  color: var(--ink-3);
  font-size: 0.85em;
  font-family: var(--font-sans);
  font-weight: 400;
}

.post-content ol {
  padding-left: 1.4rem;
  margin-bottom: 1.5rem;
}
.post-content ul {
  padding-left: 1.4rem;
  margin-bottom: 1.5rem;
}
.post-content li {
  margin-bottom: 0.4rem;
}


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

main {
  animation: fadeUp 0.4s ease both;
}

/* ─────────────────────────────────────────
   Responsive
──────────────────────────────────────────*/
@media (max-width: 560px) {
  .nav-links { gap: 1.2rem; }
  .post-list li a { flex-direction: column; gap: 0.2rem; }
  .post-meta { align-self: flex-start; }
}
