/* ===== CSS Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: #1a1a1a;
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  line-height: 1.3;
  color: #111;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

p {
  margin-bottom: 1.25rem;
}

a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #1d4ed8;
}

strong {
  font-weight: 600;
}

/* ===== Layout ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 750px;
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background: #f8f9fa;
}

.section-intro {
  font-size: 1.125rem;
  color: #555;
  margin-bottom: 2.5rem;
}

/* ===== Header ===== */
.site-header {
  padding: 1.5rem 0;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 100;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-logo {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #111;
}

.site-logo:hover {
  color: #111;
}

.site-nav {
  display: flex;
  gap: 2rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: #555;
}

.nav-link:hover {
  color: #111;
}

/* ===== Hero ===== */
.hero {
  padding: 5rem 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 4rem;
}

.hero-image {
  flex-shrink: 0;
}

.hero-image img {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.hero-text {
  flex: 1;
}

.hero-title {
  font-size: 1.25rem;
  color: #555;
  margin-bottom: 1rem;
}

.hero-tagline {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.5rem;
  font-style: italic;
  color: #333;
  margin-bottom: 0;
}

/* ===== Hero Graphic ===== */
.hero-graphic {
  background: #181e37;
  padding: 0;
  overflow: hidden;
}

.hero-graphic .container {
  max-width: 900px;
  padding: 0;
}

.hero-graphic img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== Prose ===== */
.prose {
  max-width: 700px;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.prose h3 {
  margin-top: 2rem;
}

.prose .date {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 1.5rem;
}

/* ===== Experience Grid ===== */
.experience-grid {
  display: grid;
  gap: 2rem;
}

.experience-card {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  transition: box-shadow 0.2s ease;
}

.experience-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.experience-card h3 {
  color: #111;
  margin-bottom: 0.5rem;
}

.experience-card .meta {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1rem;
}

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

/* ===== Connect ===== */
.connect-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
}

.connect-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #111;
  color: #fff;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.connect-link:hover {
  background: #333;
  color: #fff;
}

.connect-link svg {
  width: 18px;
  height: 18px;
}

/* ===== Blog ===== */
.blog-list {
  display: grid;
  gap: 2rem;
}

.blog-card {
  padding-bottom: 2rem;
  border-bottom: 1px solid #eee;
}

.blog-card:last-child {
  border-bottom: none;
}

.blog-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.blog-card h2 a {
  color: #111;
}

.blog-card h2 a:hover {
  color: #2563eb;
}

.blog-card .meta {
  font-size: 0.9rem;
  color: #777;
  margin-bottom: 0.75rem;
}

.blog-card p {
  color: #555;
}

.read-more {
  font-weight: 500;
}

/* ===== Blog Post ===== */
.blog-post {
  padding-top: 3rem;
}

.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #eee;
}

.post-header h1 {
  margin-bottom: 0.75rem;
}

.post-header .meta {
  font-size: 0.95rem;
  color: #777;
}

.blog-post hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 2.5rem 0;
}

.post-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #eee;
}

.back-link {
  font-weight: 500;
}

/* ===== Code & Mermaid ===== */
pre {
  background: #f6f8fa;
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 0.9em;
}

p code {
  background: #f0f0f0;
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

.mermaid {
  margin: 2rem 0;
  text-align: center;
}

/* ===== Taxonomy (Tags & Categories) ===== */
.taxonomy-filters {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

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

.tags-toggle {
  display: inline-block;
  background: none;
  border: 1px solid #ccc;
  border-radius: 100px;
  padding: 0.3rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  line-height: inherit;
}

.tags-toggle:hover {
  border-color: #999;
  color: #333;
}

.tags-toggle-icon {
  display: inline-block;
  font-size: 0.55rem;
  transition: transform 0.2s ease;
  vertical-align: middle;
}

.tags-toggle[aria-expanded="true"] .tags-toggle-icon {
  transform: rotate(90deg);
}

.tags-collapsible {
  display: none;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tags-collapsible.tags-visible {
  display: flex;
}

.taxonomy-chip {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.chip-category {
  background: #111;
  color: #fff;
}

.chip-category:hover {
  background: #333;
  color: #fff;
}

.chip-tag {
  background: #f0f0f0;
  color: #555;
}

.chip-tag:hover {
  background: #e0e0e0;
  color: #333;
}

.taxonomy-chip-lg {
  padding: 0.5rem 1.25rem;
  font-size: 0.95rem;
}

.taxonomy-count {
  display: inline-block;
  margin-left: 0.4rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.1rem 0.5rem;
  border-radius: 100px;
  font-size: 0.75rem;
}

.chip-tag .taxonomy-count {
  background: rgba(0, 0, 0, 0.08);
}

.taxonomy-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #777;
  align-self: center;
}

.post-taxonomies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
  align-items: center;
}

.taxonomy-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.taxonomy-header {
  margin-bottom: 2.5rem;
}

.taxonomy-header h1 {
  margin-top: 0.5rem;
}

/* ===== Footer ===== */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid #eee;
  text-align: center;
}

.site-footer p {
  font-size: 0.9rem;
  color: #777;
  margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .section {
    padding: 3rem 0;
  }
  
  .hero-content {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }
  
  .hero-image img {
    width: 180px;
    height: 180px;
  }
  
  .hero-tagline {
    font-size: 1.25rem;
  }
  
  .site-nav {
    gap: 1rem;
  }
  
  .nav-link {
    font-size: 0.85rem;
  }
  
  .connect-links {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Docs Preview Link */
.docs-preview {
  display: block;
  margin-top: 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.docs-preview:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.docs-preview img {
  width: 100%;
  display: block;
}

.docs-preview span {
  display: block;
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  font-weight: 500;
  color: #2563eb;
}

/* Quote Posts */
.post-quote .quote-post {
  margin: 0;
  position: relative;
  padding-top: 3rem;
}

.post-quote .quote-post::before {
  content: '\201C';
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 12rem;
  line-height: 1;
  position: absolute;
  top: -1.5rem;
  left: -0.25rem;
  color: rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.post-quote .quote-post p {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 2rem;
  line-height: 1.5;
  color: #1a1a1a;
  margin-bottom: 1.5rem;
}

.post-quote .quote-author {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-style: normal;
  color: #333;
}

/* Photo Posts */
.post-photo .photo-post {
  margin: 0;
}

.post-photo .photo-post picture {
  display: block;
}

.post-photo .photo-post img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.post-photo .photo-post figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: #666;
  text-align: center;
  font-style: italic;
}

/* Quote Card in List */
.card-quote .quote-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-quote .quote-link:hover .quote-post {
  color: #0066cc;
}

.card-quote .quote-post {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.5rem;
  line-height: 1.5;
  color: #1a1a1a;
  margin: 0 0 1rem 0;
  border: none;
  padding: 2.5rem 0 0 0;
  position: relative;
}

.card-quote .quote-post::before {
  content: '\201C';
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 10rem;
  line-height: 1;
  position: absolute;
  top: -1.25rem;
  left: -0.15rem;
  color: rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.card-quote .quote-author {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-style: normal;
  color: #333;
}

/* Cover Image in Text Cards */
.card-text .card-cover {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

.card-text picture {
  display: block;
  margin-bottom: 0.75rem;
}

/* Photo Card in List */
.card-photo picture {
  display: block;
  margin-bottom: 0.75rem;
}

.card-photo .card-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.card-photo .caption {
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
}