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

/* Typography scale */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: Georgia, 'Times New Roman', Times, serif;
  --color-text: #111;
  --color-muted: #6b7280;
  --color-subtle: #9ca3af;
  --color-border: #e5e7eb;
  --color-bg: #fff;
  --color-accent: #111;
}

/* Base — serif body for long-form reading */
body {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* Layout */
main {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

main.main--wide {
  max-width: 980px;
}

/* ─── Header ─── */
.site-header {
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-sans);
}

.header-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-name {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  padding-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.site-name:hover {
  color: #444;
}

.tab-nav {
  display: flex;
  gap: 0;
  flex: 1;
}

.tab-nav .tab {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0 1rem 1rem;
  text-decoration: none;
  color: var(--color-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  letter-spacing: 0.01em;
}

.tab-nav .tab:first-child {
  padding-left: 0;
}

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

.tab-nav .tab.active {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

/* ─── Footer ─── */
.site-footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--color-subtle);
}

/* ─── About / Homepage ─── */
.about-section {
  margin-bottom: 2.5rem;
}

.profile-image {
  width: 100%;
  max-width: 480px;
  height: auto;
  border-radius: 0;
  display: block;
  margin-bottom: 1.5rem;
}

.about-section p {
  margin-bottom: 1rem;
}

.about-links {
  margin-top: 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

.about-links a {
  margin-right: 1rem;
  color: var(--color-text);
  text-underline-offset: 2px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.latest-post {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.latest-post h2 {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-subtle);
  margin-bottom: 0.75rem;
}

/* ─── Writing List ─── */
.post-meta {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-subtle);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.post-excerpt {
  color: #555;
  font-size: 0.875rem;
  line-height: 1.5;
  font-family: var(--font-sans);
}

/* Card grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
  background: #fff;
}

.post-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.post-card-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f3f4f6;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.post-card:hover .post-card-image img {
  transform: scale(1.03);
}

.post-card-image--empty {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.post-card-body {
  padding: 1rem 1.1rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.post-card-title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--color-text);
  margin: 0;
}

.post-card-excerpt {
  font-family: var(--font-sans);
  font-size: 0.825rem;
  color: var(--color-muted);
  line-height: 1.5;
  margin-top: 0.2rem;
}

/* Legacy list styles (used on homepage) */
.post-list {
  list-style: none;
}

.post-list li {
  margin-bottom: 1.75rem;
}

.post-list .post-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.post-list .post-title a {
  color: var(--color-text);
  text-decoration: none;
}

.post-list .post-title a:hover {
  color: #444;
}

/* homepage latest post title */
.latest-post .post-title {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

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

.latest-post .post-title a:hover {
  color: #444;
}

/* ─── Article ─── */
.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.article-header h1 {
  font-family: var(--font-sans);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
}

/* Article body stays serif for readability */
.article-content p {
  margin-bottom: 1.3rem;
}

.article-content h2 {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 0.75rem;
  line-height: 1.2;
}

.article-content h3 {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2rem 0 0.5rem;
}

.article-content h4 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.4rem;
}

.article-content img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  display: block;
  border-radius: 4px;
}

.article-content blockquote {
  border-left: 3px solid var(--color-border);
  margin: 1.75rem 0;
  padding: 0.25rem 1.25rem;
  font-style: italic;
  color: #555;
}

.article-content ul,
.article-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.4rem;
}

.article-content a {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: #ccc;
}

.article-content a:hover {
  text-decoration-color: var(--color-text);
}

.article-content figcaption {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--color-muted);
  text-align: center;
  margin-top: -1.25rem;
  margin-bottom: 2rem;
}

.article-content code {
  font-size: 0.85em;
  background: #f3f4f6;
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.article-content pre {
  background: #f3f4f6;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-content pre code {
  background: none;
  padding: 0;
}

.original-link {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--color-muted);
}

.original-link a {
  color: var(--color-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ─── Speaking ─── */
.speaking-section h2 {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-subtle);
  margin: 2.5rem 0 1.25rem;
}

.speaking-section h2:first-child {
  margin-top: 0;
}

.event-list {
  list-style: none;
}

.event-list li {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.event-list li:last-child {
  border-bottom: none;
}

.event-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}

.event-detail {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-subtle);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}

.event-description {
  font-size: 0.95em;
  color: #444;
  margin-top: 0.3rem;
}

.event-video {
  margin-top: 1rem;
}

.event-video iframe {
  max-width: 100%;
}

/* ─── Podcast ─── */
.podcast-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.podcast-header p {
  margin-bottom: 1rem;
}

.platform-links {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
}

.platform-links a {
  margin-right: 1rem;
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: #ccc;
}

.platform-links a:hover {
  text-decoration-color: var(--color-text);
}

.episode-list {
  list-style: none;
}

.episode-list li {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.episode-list li:last-child {
  border-bottom: none;
}

.episode-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}

.episode-meta {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-subtle);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}

.episode-description {
  font-size: 0.95em;
  color: #444;
  margin-bottom: 0.4rem;
}

.episode-player {
  display: block;
  width: 100%;
  margin-top: 1rem;
}

.soundcloud-player {
  height: 166px;
  border: none;
}

.episode-links {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

.episode-links a {
  margin-right: 0.8rem;
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: #ccc;
}

.episode-links a:hover {
  text-decoration-color: var(--color-text);
}

/* ─── Responsive ─── */
@media (max-width: 720px) {
  body {
    font-size: 17px;
  }

  main {
    padding: 1.5rem 1rem;
  }

  .header-inner {
    padding: 1.25rem 1rem 0;
    gap: 1rem;
  }

  .tab-nav .tab {
    padding: 0 0.75rem 1rem;
    font-size: 0.825rem;
  }

  .article-header h1 {
    font-size: 1.6rem;
  }

  .post-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}
