/* ========================================
   Brandon Chui's Website - Main Stylesheet
   ======================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400&family=Merriweather:wght@400;700&family=Montserrat:wght@700;900&display=swap');

/* ========================================
   CSS Custom Properties (Light/Dark Theme)
   ======================================== */
:root {
  /* Light Mode Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --border-color: #e5e7eb;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --code-bg: rgba(0, 0, 0, 0.05);
  --code-text: #b45309;
  --code-border: #e5e7eb;

  /* Typography */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Merriweather', Georgia, serif;
  --font-code: 'Fira Code', monospace;

  /* Spacing */
  --sidebar-width: 280px;
  --nav-height: 64px;
  --content-max-width: 800px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
}

[data-theme="dark"] {
  --bg-primary: #1C1C1C;
  --bg-secondary: #222222;
  --border-color: #333333;
  --text-primary: #d1d5db;
  --text-secondary: #a1a1aa;
  --text-muted: #737373;
  --accent: #ffffff;
  --accent-hover: #ffffff;
  --code-bg: #282828;
  --code-text: #ebdbb2;
  --code-border: #3c3836;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* ========================================
   Typography
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
}

code, pre {
  font-family: var(--font-code);
}

:not(pre) > code {
  background-color: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--code-border);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

pre {
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0;
  border: none;
}

.code-block-wrapper {
  position: relative;
  margin: 1.5rem 0;
}

.code-block-wrapper pre,
.blog-post-content .code-block-wrapper pre {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  margin: 0;
}

.code-annotation {
  font-family: var(--font-code);
  font-size: 0.7rem;
  font-style: italic;
  color: var(--text-muted);
  background-color: var(--border-color);
  padding: 0.35rem 1rem;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border: 1px solid var(--border-color);
  border-bottom: none;
  line-height: 1.4;
}

.callout {
  border-left: 3px solid var(--border-color);
  background-color: var(--bg-secondary);
  border-radius: 0 6px 6px 0;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.callout-label {
  display: block;
  font-family: var(--font-code);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

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

pre mark {
  display: block;
  background-color: rgba(255, 255, 255, 0.06);
  border-left: 2px solid var(--text-muted);
  margin: 0 -1rem;
  padding: 0 calc(1rem - 2px);
  color: inherit;
}

[data-theme="light"] pre mark {
  background-color: rgba(0, 0, 0, 0.04);
}

/* ========================================
   Layout Structure
   ======================================== */

/* Desktop Sidebar Layout (>1280px) */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  text-align: center;
  margin-bottom: 2rem;
}

.profile-pic {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-color);
  margin-bottom: 1rem;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.site-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
}

.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 0.5rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  color: var(--text-primary);
  font-weight: 500;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-nav a:hover {
  background-color: var(--border-color);
  color: var(--accent);
}

.sidebar-nav a.active {
  background-color: var(--border-color);
  color: var(--accent);
  font-weight: 700;
}

/* Dark Mode Toggle in Sidebar */
.sidebar-footer {
  padding-top: 1rem;
}

.sidebar-social {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sidebar-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.sidebar-social a:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.sidebar-social svg {
  width: 18px;
  height: 18px;
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.content-wrapper {
  flex: 1;
  padding: 2rem;
  max-width: var(--content-max-width);
  margin: 0 auto;
  width: 100%;
}

/* ========================================
   Top Navigation (Tablet: 640px - 1280px)
   ======================================== */
.top-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.5rem;
  z-index: 100;
  transition: transform var(--transition-normal);
}

.top-nav.hidden {
  transform: translateY(-100%);
}

.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.top-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.top-nav-brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.nav-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.nav-avatar:hover {
  border-color: var(--text-muted);
  color: var(--accent);
}

.nav-avatar-lg {
  width: 120px;
  height: 120px;
  font-size: 3rem;
  margin: 0 auto 1rem;
}

.top-nav-brand span {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.top-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.top-nav-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
  padding: 0.5rem;
  transition: color var(--transition-fast);
}

.top-nav-links a:hover,
.top-nav-links a.active {
  color: var(--accent);
}

/* ========================================
   Mobile Navigation (<640px)
   ======================================== */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 1rem;
  z-index: 100;
}

.mobile-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.mobile-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
}

/* Hamburger Button */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 28px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 110;
}

.hamburger span {
  width: 100%;
  height: 3px;
  background-color: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-primary);
  z-index: 99;
  padding: 2rem;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
}

.mobile-menu-overlay.active {
  transform: translateX(0);
}

.mobile-menu-overlay ul {
  list-style: none;
}

.mobile-menu-overlay li {
  margin-bottom: 1rem;
}

.mobile-menu-overlay a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  font-size: 1.25rem;
  color: var(--text-primary);
  border-radius: 8px;
  transition: background-color var(--transition-fast);
}

.mobile-menu-overlay a:hover {
  background-color: var(--bg-secondary);
}

/* ========================================
   Dark Mode Toggle Button
   ======================================== */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.theme-toggle:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

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

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

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

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

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

/* ========================================
   Home Page Styles
   ======================================== */
.home-intro {
  text-align: center;
  padding: 3rem 0;
}

.home-intro h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.home-intro p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Navigation Cards Grid */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.nav-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.nav-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  border-color: var(--accent);
}

[data-theme="dark"] .nav-card:hover {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.nav-card h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.nav-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.nav-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  padding: 2rem;
  border-top: none;
  text-align: center;
}

.footer::before {
  display: none;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  color: var(--text-muted);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.footer-social a:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.footer-social svg {
  width: 20px;
  height: 20px;
}

.footer-copyright {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ========================================
   Responsive Breakpoints
   ======================================== */

/* Tablet: 640px - 1280px */
@media (max-width: 1280px) {
  .sidebar {
    display: none;
  }

  .top-nav {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding-top: var(--nav-height);
  }

  .content-wrapper {
    padding: 1.5rem;
  }
}

/* Mobile: < 640px */
@media (max-width: 640px) {
  .top-nav {
    display: none;
  }

  .mobile-nav {
    display: block;
  }

  .nav-cards {
    grid-template-columns: 1fr;
  }

  .home-intro h1 {
    font-size: 2rem;
  }

  .home-intro p {
    font-size: 1rem;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .mobile-menu-overlay .sidebar-social a,
  .mobile-menu-overlay .sidebar-social .theme-toggle {
    width: 48px;
    height: 48px;
  }

  .mobile-menu-overlay .sidebar-social svg {
    width: 24px;
    height: 24px;
  }
}

/* ========================================
   Utility Classes
   ======================================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ========================================
   Projects Page Styles
   ======================================== */

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-row {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.project-row:hover {
  border-color: var(--text-muted);
}

.project-row a {
  display: flex;
  gap: 1.5rem;
  color: inherit;
  text-decoration: none;
  padding: 1rem;
}

.project-thumb {
  width: 180px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background-color: var(--bg-secondary);
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.project-row:hover .project-thumb img {
  transform: scale(1.05);
}

.project-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-info h2 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  margin-bottom: 0.375rem;
  color: var(--text-primary);
}

.project-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

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

.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

@media (max-width: 640px) {
  .project-row a {
    flex-direction: column;
    gap: 1rem;
  }

  .project-thumb {
    width: 100%;
    height: 180px;
  }
}

/* ========================================
   Blog Page Styles
   ======================================== */

.blog-header {
  text-align: center;
  margin-bottom: 3rem;
}

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

.blog-header p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Blog Search */
.blog-search {
  margin-bottom: 1.5rem;
}

.blog-search-input-wrapper {
  position: relative;
}

.blog-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.blog-search-input {
  width: 100%;
  padding: 0.6rem 0.75rem 0.6rem 2.25rem;
  font-family: var(--font-code);
  font-size: 0.875rem;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.blog-search-input::placeholder {
  color: var(--text-muted);
}

.blog-search-input:focus {
  border-color: var(--text-muted);
}

/* Tag pills container */
.blog-tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height var(--transition-normal), opacity var(--transition-normal), margin var(--transition-normal);
  margin-top: 0;
}

.blog-tag-pills-visible {
  max-height: 200px;
  opacity: 1;
  margin-top: 0.75rem;
}

/* Tag pill button */
.blog-tag-pill {
  cursor: pointer;
  font-family: var(--font-code);
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.blog-tag-pill:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.tag-active {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.tag-active:hover {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

/* Inline blog tags next to titles */
.blog-tags {
  display: inline;
  margin-left: 0.5rem;
}

.blog-inline-tag {
  font-size: 0.6875rem;
  padding: 0.1rem 0.4rem;
  vertical-align: middle;
}

@media (max-width: 768px) {
  .blog-tags {
    display: none;
  }
}

/* Search result count */
.blog-search-count {
  font-family: var(--font-code);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  display: none;
}

.blog-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.blog-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.blog-table thead tr {
  border-bottom: 1px solid var(--border-color);
}

.blog-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.blog-table th.col-date {
  width: 120px;
}

.blog-table th.col-readtime {
  width: 100px;
  text-align: right;
}

/* Hide read time header on mobile */
@media (max-width: 768px) {
  .blog-table th.col-readtime {
    display: none;
  }
}

.blog-row {
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-fast);
}

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

.blog-row:hover {
  background-color: var(--bg-secondary);
}

.blog-cell {
  padding: 0;
}

.blog-link {
  display: flex;
  width: 100%;
  padding: 0.75rem 1rem;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.blog-date {
  flex-shrink: 0;
  width: 120px;
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.blog-row:hover .blog-date {
  color: var(--text-primary);
}

.blog-title {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: color var(--transition-fast);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blog-row:hover .blog-title {
  color: var(--text-primary);
  white-space: normal;
  overflow: visible;
}

.blog-readtime {
  flex-shrink: 0;
  width: 100px;
  text-align: right;
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.blog-row:hover .blog-readtime {
  color: var(--text-primary);
}

/* Hide read time on mobile */
@media (max-width: 768px) {
  .blog-readtime {
    display: none;
  }

  .blog-header h1 {
    font-size: 2rem;
  }

  .blog-header p {
    font-size: 1rem;
  }
}

.blog-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
}

/* ========================================
   Blog Post Page Styles
   ======================================== */

.blog-post {
  max-width: 680px;
}

.blog-post-header {
  margin-bottom: 2.5rem;
}

.blog-post-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--font-code);
}

.blog-post-meta .separator {
  color: var(--border-color);
}

.blog-post-updated {
  font-style: italic;
}

.blog-post-content {
  line-height: 1.8;
  color: var(--text-secondary);
}

.blog-post-content .zola-anchor {
  color: inherit;
  text-decoration: none;
}

.blog-post-content h2 {
  font-size: 1.25rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.blog-post-content h3 {
  font-size: 1.0625rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.blog-post-content h4 {
  font-size: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.blog-post-content p {
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}

.blog-post-content blockquote {
  border-left: 2px solid var(--border-color);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.blog-post-content ul,
.blog-post-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  font-size: 0.9375rem;
}

.blog-post-content li {
  margin-bottom: 0.375rem;
}

.blog-post-content a {
  color: #6b8aaf;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-post-content a:hover {
  color: #8fafc8;
}

.blog-post-content img {
  border-radius: 6px;
  margin: 1.5rem 0;
}

.blog-post-content pre {
  font-size: 0.8125rem;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
}

.blog-post-content code {
  font-size: 0.8125rem;
}

.blog-post-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 3rem;
}

.blog-post-tags-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.blog-post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--font-code);
  transition: color var(--transition-fast);
}

.top-link:hover {
  color: var(--text-primary);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-family: var(--font-code);
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .blog-post-header h1 {
    font-size: 1.25rem;
  }
}

/* ========================================
   About Page Styles
   ======================================== */

.about-page {
  max-width: 640px;
  margin: 0 auto;
}

.about-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.about-pic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--border-color);
}

.about-header h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.about-linkedin {
  display: inline-flex;
  vertical-align: middle;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

.about-linkedin:hover {
  color: var(--text-primary);
}

.about-linkedin svg {
  width: 20px;
  height: 20px;
}

.about-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin: 0;
}

.about-location {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin: 0.25rem 0 0;
}

.about-location svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.about-contact {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  margin: 0.25rem 0 0;
}

.about-contact svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.about-contact a {
  color: var(--text-muted);
  text-decoration: none;
}

.about-contact a:hover {
  color: var(--text-primary);
}

.about-body p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.about-body a {
  color: #6b8aaf;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-body a:hover {
  color: #8fafc8;
}

.about-body h2 {
  font-size: 1.125rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.about-tools {
  list-style: none;
  padding: 0;
}

.about-tools li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.about-tools li:last-child {
  border-bottom: none;
}

.about-tools strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Currently... section */
.currently-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.currently-header h2 {
  margin: 0;
}

.currently-updated {
  font-family: var(--font-code);
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.currently-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.currently-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
}

.currently-label {
  font-family: var(--font-code);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.currently-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  line-height: 1.5;
}

@media (max-width: 480px) {
  .currently-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   Blog Post Table of Contents
   ======================================== */

/* Widen content-wrapper on blog post pages with TOC */
.content-wrapper:has(.blog-post-layout) {
  max-width: 1060px;
}

/* Grid layout: article + TOC sidebar */
.blog-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 680px) 200px;
  gap: 3rem;
}

/* --- TOC Sidebar (wide screens) --- */
.toc-sidebar {
  display: block;
}

.toc-sticky {
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.toc-sticky::-webkit-scrollbar {
  width: 4px;
}

.toc-sticky::-webkit-scrollbar-track {
  background: transparent;
}

.toc-sticky::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 2px;
}

.toc-sidebar-title {
  font-family: var(--font-code);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.toc-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-sidebar ul ul {
  padding-left: 0.75rem;
}

/* --- TOC Inline (narrow screens, collapsed by default) --- */
.toc-inline {
  display: none;
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 2rem;
}

.toc-inline[open] {
  padding-bottom: 1rem;
}

.toc-inline-title {
  font-family: var(--font-code);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-inline-title::-webkit-details-marker {
  display: none;
}

.toc-inline-title::after {
  content: '>';
  font-size: 0.625rem;
  transition: transform var(--transition-fast);
}

.toc-inline[open] .toc-inline-title::after {
  transform: rotate(90deg);
}

.toc-inline ul {
  margin-top: 0.5rem;
}

.toc-inline ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-inline ul ul {
  padding-left: 0.75rem;
}

.toc-inline .toc-link {
  font-size: 0.8125rem;
}

/* --- Shared TOC link styles --- */
.toc-link {
  display: block;
  font-family: var(--font-code);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.2rem 0 0.2rem 0.625rem;
  border-left: 2px solid transparent;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.toc-link:hover {
  color: var(--text-primary);
}

.toc-link.active {
  color: var(--text-primary);
  border-left-color: var(--text-primary);
}

/* --- Responsive: below 1080px --- */
@media (max-width: 1080px) {
  .content-wrapper:has(.blog-post-layout) {
    max-width: var(--content-max-width);
  }

  .blog-post-layout {
    display: block;
  }

  .toc-sidebar {
    display: none;
  }

  .toc-inline {
    display: block;
  }
}

/* --- Tablet: account for fixed top-nav --- */
@media (min-width: 1081px) and (max-width: 1280px) {
  .toc-sticky {
    top: calc(var(--nav-height) + 1rem);
    max-height: calc(100vh - var(--nav-height) - 2rem);
  }
}
