:root {
  --bg: #fafaf9;
  --bg-warm: #f8f6f3;
  --text-heading: #1c1917;
  --text-body: #44403c;
  --text-secondary: #78716c;
  --text-muted: #a8a29e;
  --accent: #d97706;
  --accent-light: #fef3c7;
  --border: #e7e5e4;
  --border-warm: #d6d3d1;
  --max-width: 640px;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

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

a:hover {
  text-decoration: underline;
}

body {
  font-family: var(--font-serif);
  background: var(--bg);
  color: var(--text-body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Page entrance */

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

main > * {
  animation: fadeIn 0.5s ease both;
}

main > *:nth-child(2) {
  animation-delay: 0.08s;
}

/* Header */

.site-header {
  padding-top: 96px;
  padding-bottom: 48px;
}

.site-header h1 {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.subtitle {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.header-rule {
  display: block;
  width: 40px;
  height: 3px;
  background: var(--accent);
  border: none;
  margin-top: 24px;
  border-radius: 2px;
}

/* Headshot */

.headshot {
  float: right;
  width: 200px;
  height: 200px;
  border-radius: 10px;
  object-fit: cover;
  margin: -100px -80px 1.25em 1.5em;
  box-shadow:
    0 4px 16px rgba(28, 25, 23, 0.08),
    0 1px 4px rgba(28, 25, 23, 0.05);
  border: 3px solid var(--bg);
  outline: 1px solid var(--border);
}

/* Narrative content */

.narrative p {
  margin-bottom: 1em;
}

.narrative p:last-child {
  margin-bottom: 0;
}

.narrative hr {
  border: none;
  margin: 2em 0;
  height: 1px;
  background: linear-gradient(to right, var(--border), transparent);
  max-width: 120px;
}

.narrative a {
  color: var(--accent);
  text-decoration: none;
  text-decoration-skip-ink: auto;
}

.narrative a:hover {
  text-decoration: underline;
}

/* Hook section (first two paragraphs, after headshot image) */
.narrative p:nth-child(2),
.narrative p:nth-child(3) {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.55;
}

/* Closing line */
.narrative > p:last-child {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-secondary);
}

/* Footer */

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 1.5rem 48px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 32px;
}

.site-footer span {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.footer-icons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-icon {
  display: flex;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-icon:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Writing list */

.writing-list-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 48px;
}

.writing-list-title {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  margin-bottom: 0;
}

.rss-link {
  color: var(--text-muted);
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.rss-link:hover {
  color: var(--accent);
}

.writing-entry {
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
}

.writing-entry:last-child {
  border-bottom: none;
}

.writing-entry-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.35;
  margin-bottom: 6px;
}

.writing-entry-date {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary);
}

.writing-entry-excerpt {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--text-body);
  line-height: 1.65;
  margin-top: 12px;
}

.writing-entry-readmore {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
  transition: gap 0.2s ease;
}

.writing-entry-readmore:hover {
  text-decoration: underline;
}

/* Back link */

.back-link {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Post */

.post-header {
  margin-bottom: 0;
}

.post-title {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 12px;
}

.post-date {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 48px;
}

.post-body p {
  margin-bottom: 1.25em;
}

.post-body > *:first-child {
  margin-top: 0;
}

.post-body > *:last-child {
  margin-bottom: 0;
}

.post-body h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.01em;
  margin-top: 2.5em;
  margin-bottom: 0.75em;
  padding-bottom: 0.35em;
  border-bottom: 2px solid var(--accent-light);
}

.post-body strong {
  color: var(--text-heading);
  font-weight: 600;
}

.post-body a {
  color: var(--accent);
  text-decoration: none;
}

.post-body a:hover {
  text-decoration: underline;
}

.post-body ul,
.post-body ol {
  margin-bottom: 1.25em;
  padding-left: 1.25em;
}

.post-body li {
  margin-bottom: 0.5em;
}

.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25em;
  margin: 1.5em 0;
  color: var(--text-secondary);
  font-style: italic;
}

.post-body img,
.writing-entry img {
  display: block;
  width: calc(100% + 200px);
  max-width: min(960px, 100vw - 2rem);
  margin-left: 50%;
  transform: translateX(-50%);
  height: auto;
  border-radius: 8px;
  margin-top: 2em;
  margin-bottom: 2em;
  box-shadow: 0 2px 12px rgba(28, 25, 23, 0.06);
}

/* Read time */

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.post-meta time {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary);
}

.post-meta-sep {
  color: var(--text-muted);
  font-size: 12px;
}

.post-meta .read-time {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary);
}

/* Mobile */

@media (max-width: 640px) {
  .site-header {
    padding-top: 64px;
    padding-bottom: 40px;
  }

  .site-header h1 {
    font-size: 36px;
  }

  .narrative hr {
    margin: 1.5em 0;
  }

  .headshot {
    width: 120px;
    height: 120px;
    margin: 0.15em 0 0.75em 1.25em;
    margin-right: 0;
  }

  .narrative p:nth-child(2),
  .narrative p:nth-child(3) {
    font-size: 18px;
  }

  .site-footer {
    padding-top: 40px;
    padding-bottom: 32px;
  }

  .post-title {
    font-size: 28px;
  }

  .post-body h2 {
    font-size: 20px;
  }

  .writing-entry {
    margin-bottom: 36px;
    padding-bottom: 36px;
  }

  .post-meta {
    flex-wrap: wrap;
    gap: 4px 12px;
  }
}
