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

:root {
  --text:    #1a1a1a;
  --muted:   #666;
  --border:  #e0e0e0;
  --bg:      #ffffff;
  --accent:  #1a1a1a;
  --code-bg: #f0f0f0;
  --max:     680px;
  --serif:   Georgia, "Times New Roman", serif;
  --sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono:    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --text:    #e8e8e8;
  --muted:   #888;
  --border:  #2e2e2e;
  --bg:      #111111;
  --accent:  #e8e8e8;
  --code-bg: #1e1e1e;
}

[data-theme="dark"] .post-tag[data-tag="startup-series"] { background: #3a1a08; color: #fb923c; border-color: #7c2d12; }
[data-theme="dark"] .post-tag[data-tag="technical"]      { background: #0f1f3d; color: #60a5fa; border-color: #1e3a5f; }
[data-theme="dark"] .post-tag[data-tag="leadership"]     { background: #1e0f3a; color: #c084fc; border-color: #3b1f6e; }
[data-theme="dark"] .post-tag[data-tag="number"]         { background: #1a1f26; color: #94a3b8; border-color: #2d3748; }

html { font-size: 18px; }

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
}

/* Layout */

.site-header {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

nav a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

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

.nav-social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border);
}

.nav-social a {
  color: var(--muted);
  display: flex;
  align-items: center;
  font-size: 0;
}

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

.nav-social svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.theme-toggle {
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  padding: 0 0 0 1rem;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  line-height: 0;
}

.theme-toggle:hover { color: var(--text); }

.theme-toggle svg {
  width: 15px;
  height: 15px;
}

.theme-toggle .icon-moon { display: none; }

[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.copyright {
  font-size: 0.82rem;
  color: var(--muted);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 6rem;
}

footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

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

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

/* Index page */

.index-title {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 2.5rem;
}

.post-list { list-style: none; margin: 0; padding: 0; }

.post-list li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0 1.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}

.post-list li:first-child { border-top: 1px solid var(--border); }

.post-date {
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.post-link {
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}

.post-link:hover { text-decoration: underline; }

.post-tag {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.6;
}

.post-tags {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
}

.post-tag[data-tag="startup-series"] { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.post-tag[data-tag="technical"]      { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.post-tag[data-tag="leadership"]     { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }
.post-tag[data-tag="number"]         { background: #f8fafc; color: #475569; border-color: #cbd5e1; }

/* Post page */

.post-header { margin-bottom: 3rem; }

.post-header h1 {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

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

.post-meta span + span::before { content: " · "; }

/* Prose */

.prose { font-family: var(--serif); font-size: 1rem; }

.prose p { margin: 0 0 1.4em; }

.prose h2 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2.5em 0 0.75em;
}

.prose h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  margin: 2em 0 0.5em;
}

.prose blockquote {
  margin: 1.5em 0;
  padding: 0 0 0 1.25rem;
  border-left: 3px solid var(--border);
  color: var(--muted);
  font-style: italic;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.prose pre {
  background: var(--code-bg);
  padding: 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  line-height: 1.5;
  margin: 1.5em 0;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 0.83rem;
}

.prose ul, .prose ol {
  padding-left: 1.5em;
  margin: 0 0 1.4em;
}

.prose li { margin-bottom: 0.35em; }

.prose a { color: var(--text); }
.prose a:hover { color: var(--muted); }

.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

/* Back link */

.back {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2.5rem;
}

.back:hover { color: var(--text); }
.back::before { content: "← "; }

/* Responsive */

@media (max-width: 520px) {
  html { font-size: 16px; }
  .site-header { padding: 2rem 1rem 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
  main { padding: 0 1rem 4rem; }
  .post-list li { grid-template-columns: 1fr; gap: 0.1rem; }
  .post-date { font-size: 0.78rem; }
}

/* ─── Archive page ──────────────────────────────────────────────── */

.archive-year-group {
  margin-bottom: 2.75rem;
}

.archive-year {
  font-family: var(--sans);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.archive-year-icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.archive-list li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.archive-item-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
}

.archive-item-title-row .post-tags {
  margin: 0;
}

.archive-item-title-row .post-tag {
  font-size: 0.48rem;
}

.archive-icon {
  width: 13px;
  height: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

.archive-list a {
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
}

.archive-list a:hover {
  color: var(--muted);
}

.archive-item-coming {
  opacity: 0.45;
}

.archive-item-coming .archive-item-title-row > span:first-of-type {
  font-size: 0.9rem;
}

.coming-tag {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  flex-shrink: 0;
  margin-left: 0.25rem;
}

/* ─── Homepage ─────────────────────────────────────────────────── */

.home-intro {
  margin-bottom: 3.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.profile {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
}

.profile-photo {
  display: block;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  object-position: left center;
}


/* ─── Post list with hook lines ─────────────────────────────────── */

.post-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.post-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-title-row .post-tags {
  margin: 0;
}

.post-title-row .post-tag {
  font-size: 0.48rem;
}

.post-hook {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
  font-family: var(--sans);
}

/* ─── Override post-list grid for hook layout ───────────────────── */

.post-list li {
  align-items: start;
  padding: 1rem 0;
}