/* ============================================
   GurgelHub - A Distinctive Reading Experience
   ============================================
   Typography: JetBrains Mono + Crimson Pro
   Theme: Warm Obsidian with Amber Accents
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Obsidian Palette */
  --bg-deep: #0d0f12;
  --bg-primary: #12151a;
  --bg-elevated: #181c23;
  --bg-surface: #1e232c;
  --bg-hover: #252b37;

  /* Text Colors */
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --text-muted: #5f6368;
  --text-inverse: #0d0f12;

  /* Accent - Warm Amber */
  --accent-primary: #f59e0b;
  --accent-secondary: #fbbf24;
  --accent-muted: rgba(245, 158, 11, 0.15);
  --accent-glow: rgba(245, 158, 11, 0.3);

  /* Semantic Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-accent: rgba(245, 158, 11, 0.4);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(245, 158, 11, 0.15);

  /* Typography */
  --font-display: 'Crimson Pro', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --content-width: 720px;
  --wide-width: 1200px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-deep);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection {
  background-color: var(--accent-primary);
  color: var(--text-inverse);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: 2.75rem; font-weight: 700; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

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

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

strong, b {
  font-weight: 600;
  color: var(--text-primary);
}

em, i {
  font-style: italic;
}

/* ---------- Layout Components ---------- */
.container {
  width: 100%;
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.content-width {
  max-width: var(--content-width);
  margin: 0 auto;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 18, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  max-width: var(--wide-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

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

.nav-brand:hover {
  color: var(--accent-primary);
}

.nav-brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

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

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-primary);
  transition: width var(--transition-base);
}

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

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Search Bar */
.search-wrapper {
  position: relative;
}

.search-input {
  width: 240px;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: 9999px;
  outline: none;
  transition: all var(--transition-fast);
}

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

.search-input:focus {
  width: 300px;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

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

/* Mobile Menu Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
}

/* ---------- Main Content Area ---------- */
main {
  flex: 1;
  padding: 3rem 0;
}

/* ---------- Article Cards (Homepage) ---------- */
.articles-header {
  margin-bottom: 3rem;
  text-align: center;
}

.articles-header h1 {
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.articles-header p {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.article-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.75rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.article-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.article-card:hover::before {
  opacity: 1;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  background: var(--accent-muted);
  color: var(--accent-primary);
  border-radius: 9999px;
  border: 1px solid var(--border-accent);
}

.article-card-title {
  font-size: 1.375rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.article-card-title a {
  color: var(--text-primary);
}

.article-card-title a:hover {
  color: var(--accent-primary);
}

.article-card-description {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.article-meta-item svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-inverse);
}

/* ---------- Article Page ---------- */
.article-container {
  max-width: var(--content-width);
  margin: 0 auto;
}

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

.article-header .article-tags {
  justify-content: center;
  margin-bottom: 1.5rem;
}

.article-header h1 {
  font-size: 2.75rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.article-header-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.reading-time {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 64px;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  z-index: 99;
  transition: width 50ms linear;
}

/* Table of Contents */
.toc-wrapper {
  position: fixed;
  left: calc(50% + 400px);
  top: 120px;
  width: 240px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  display: none;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.toc-wrapper::-webkit-scrollbar {
  width: 6px;
}

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

.toc-wrapper::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 3px;
}

.toc-wrapper::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

@media (min-width: 1400px) {
  .toc-wrapper {
    display: block;
  }
}

.toc {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

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

.toc-item {
  margin-bottom: 0.5rem;
}

.toc-link {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: block;
  padding: 0.25rem 0;
  padding-left: 0.75rem;
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
}

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

.toc-item.level-3 .toc-link {
  padding-left: 1.5rem;
  font-size: 0.8125rem;
}

/* ---------- Markdown Content Styling ---------- */
.markdown-body {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.markdown-body > * + * {
  margin-top: 1.5rem;
}

/* Headings */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  scroll-margin-top: 5rem;
}

.markdown-body h2 {
  font-size: 1.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.markdown-body h3 {
  font-size: 1.375rem;
}

.markdown-body h4 {
  font-size: 1.125rem;
}

/* Links */
.markdown-body a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent-muted);
  text-underline-offset: 3px;
  transition: all var(--transition-fast);
}

.markdown-body a:hover {
  color: var(--accent-secondary);
  text-decoration-color: var(--accent-secondary);
}

/* Lists */
.markdown-body ul,
.markdown-body ol {
  padding-left: 1.75rem;
  margin-bottom: 1.5rem;
}

.markdown-body li {
  margin-bottom: 0.5rem;
}

.markdown-body li::marker {
  color: var(--accent-primary);
}

.markdown-body ul li::marker {
  content: '▸ ';
}

/* Blockquotes */
.markdown-body blockquote {
  position: relative;
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border-left: 4px solid var(--accent-primary);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-secondary);
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Inline Code */
.markdown-body code:not([class*="language-"]):not(.codehilite code) {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.2em 0.4em;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  color: var(--accent-secondary);
}

/* Code Blocks */
.markdown-body pre,
.markdown-body .codehilite {
  position: relative;
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
}

.markdown-body pre {
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
}

.markdown-body .codehilite pre {
  margin: 0;
  border: none;
  border-radius: 0;
}

/* Code Block Header (language label) */
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: var(--accent-muted);
}

.copy-btn.copied {
  color: var(--success);
  border-color: var(--success);
}

.copy-btn svg {
  width: 14px;
  height: 14px;
}

/* Tables */
.markdown-body table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.markdown-body thead {
  background: var(--bg-surface);
}

.markdown-body th {
  font-weight: 600;
  text-align: left;
  padding: 0.875rem 1rem;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border-default);
}

.markdown-body td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.markdown-body tbody tr:hover {
  background: var(--bg-elevated);
}

.markdown-body tbody tr:last-child td {
  border-bottom: none;
}

/* Horizontal Rule */
.markdown-body hr {
  margin: 3rem 0;
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-default), transparent);
}

/* Images */
.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 2rem 0;
}

/* Task Lists */
.markdown-body .task-list-item {
  list-style: none;
  margin-left: -1.5rem;
}

.markdown-body .task-list-item input {
  margin-right: 0.5rem;
  accent-color: var(--accent-primary);
}

/* Callouts / Admonitions */
.callout {
  position: relative;
  margin: 2rem 0;
  padding: 1.25rem 1.5rem 1.25rem 3.5rem;
  border-radius: 12px;
  border: 1px solid;
}

.callout::before {
  position: absolute;
  left: 1.25rem;
  top: 1.25rem;
  font-size: 1.25rem;
}

.callout-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.callout-info {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
}

.callout-info::before {
  content: 'ℹ️';
}

.callout-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.callout-warning::before {
  content: '⚠️';
}

.callout-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.callout-danger::before {
  content: '🚨';
}

.callout-tip {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.callout-tip::before {
  content: '💡';
}

/* Footnotes */
.markdown-body .footnote {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Highlighted Text */
.markdown-body mark {
  background: var(--accent-muted);
  color: var(--accent-secondary);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}

/* Keyboard Keys */
.markdown-body kbd {
  font-family: var(--font-mono);
  font-size: 0.8125em;
  padding: 0.15em 0.4em;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--text-primary);
}

/* Abbreviations */
.markdown-body abbr {
  text-decoration: underline dotted;
  cursor: help;
}

/* ---------- Search Page ---------- */
.search-page-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.search-page-header h1 {
  margin-bottom: 0.5rem;
}

.search-page-header p {
  color: var(--text-muted);
  margin: 0;
}

.search-input-large {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 2rem;
  display: block;
  padding: 1rem 1.5rem 1rem 3rem;
  font-size: 1.125rem;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input-large:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px var(--accent-muted);
}

.search-results-info {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.search-result-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all var(--transition-base);
}

.search-result-card:hover {
  border-color: var(--border-accent);
}

.search-result-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.search-result-title a {
  color: var(--text-primary);
}

.search-result-title a:hover {
  color: var(--accent-primary);
}

.search-result-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.search-result-meta .score {
  color: var(--success);
  font-weight: 500;
}

.search-result-snippet {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.search-result-snippet mark {
  background: var(--accent-muted);
  color: var(--accent-secondary);
  padding: 0.1em 0.2em;
  border-radius: 3px;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: 8px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pagination-btn:hover:not(.disabled) {
  color: var(--text-primary);
  border-color: var(--accent-primary);
  background: var(--accent-muted);
}

.pagination-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-btn svg {
  width: 16px;
  height: 16px;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

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

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

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

/* ---------- About Page ---------- */
.about-header {
  text-align: center;
  margin-bottom: 3rem;
}

.about-subtitle {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.375rem 1rem;
  background: var(--accent-muted);
  color: var(--accent-primary);
  border-radius: 9999px;
  border: 1px solid var(--border-accent);
  margin-bottom: 1rem;
}

.about-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.about-intro {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.skill-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all var(--transition-base);
}

.skill-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.skill-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.skill-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
}

.project-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: all var(--transition-base);
}

.project-card:hover {
  border-color: var(--border-accent);
}

.project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.project-title {
  font-size: 1.375rem;
}

.project-tech {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

.project-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.social-link {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.social-link:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.social-link svg {
  width: 24px;
  height: 24px;
}

/* About Page - Story Section */
.story-section {
  margin-bottom: 4rem;
}

.story-block {
  display: flex;
  gap: 2rem;
  max-width: 640px;
  margin: 0 auto;
}

.story-marker {
  flex-shrink: 0;
}

.story-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  font-size: 1.5rem;
}

.story-content {
  flex: 1;
}

.story-lead {
  font-size: 1.25rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.story-lead strong {
  color: var(--accent-primary);
}

.story-content p:last-child {
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0;
}

/* About Page - Focus Section */
.focus-section {
  margin-bottom: 4rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

.section-number {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-primary);
  padding: 0.25rem 0.75rem;
  background: var(--accent-muted);
  border-radius: 9999px;
  border: 1px solid var(--border-accent);
}

.focus-grid {
  display: grid;
  gap: 1.25rem;
}

.focus-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.75rem;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.focus-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-primary), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.focus-card:hover {
  border-color: var(--border-accent);
  transform: translateX(4px);
}

.focus-card:hover::before {
  opacity: 1;
}

.focus-icon {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.focus-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-display);
}

.focus-card p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

/* About Page - Stack Section */
.stack-section {
  margin-bottom: 4rem;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.stack-category {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem;
}

.stack-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
}

.stack-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stack-tag {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 6px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.stack-tag:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.stack-tag.primary {
  background: var(--accent-muted);
  border-color: var(--border-accent);
  color: var(--accent-primary);
}

/* About Page - Journey Section */
.journey-section {
  margin-bottom: 4rem;
}

.journey-timeline {
  position: relative;
  padding-left: 2rem;
}

.journey-timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-primary), var(--border-subtle));
  border-radius: 1px;
}

.journey-item {
  position: relative;
  padding-bottom: 2rem;
}

.journey-item:last-child {
  padding-bottom: 0;
}

.journey-dot {
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 14px;
  height: 14px;
  background: var(--bg-deep);
  border: 2px solid var(--border-default);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.journey-item.current .journey-dot {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px var(--accent-glow);
}

.journey-item:hover .journey-dot {
  border-color: var(--accent-primary);
}

.journey-content {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  transition: all var(--transition-base);
}

.journey-item:hover .journey-content {
  border-color: var(--border-accent);
}

.journey-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.journey-content h4 {
  font-size: 1.125rem;
  margin: 0.375rem 0 0.25rem;
}

.journey-role {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem !important;
}

.journey-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 !important;
}

/* About Page - Beyond Section */
.beyond-section {
  margin-bottom: 4rem;
}

.beyond-card {
  background: linear-gradient(135deg, var(--bg-primary), var(--bg-elevated));
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.beyond-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
}

.beyond-card h3 {
  font-size: 1.375rem;
  margin-bottom: 1rem;
}

.beyond-card p {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 1rem;
  line-height: 1.7;
}

.beyond-card p strong {
  color: var(--accent-primary);
}

.beyond-cta {
  color: var(--text-muted) !important;
  font-style: italic;
  margin-bottom: 0 !important;
}

/* About Page - Connect Section */
.connect-section {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid var(--border-subtle);
}

.connect-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.connect-subtitle {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Responsive adjustments for new about sections */
@media (max-width: 768px) {
  .story-block {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .story-marker {
    display: flex;
    justify-content: center;
  }

  .story-lead {
    font-size: 1.125rem;
  }

  .stack-grid {
    grid-template-columns: 1fr;
  }

  .journey-timeline {
    padding-left: 1.5rem;
  }

  .journey-dot {
    left: -1.5rem;
  }

  .beyond-card {
    padding: 2rem 1.5rem;
  }
}

/* ---------- HTMX Loading States ---------- */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: block;
}

.htmx-request.htmx-indicator {
  display: block;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Empty States ---------- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

.stagger-1 { animation-delay: 0.1s; opacity: 0; }
.stagger-2 { animation-delay: 0.2s; opacity: 0; }
.stagger-3 { animation-delay: 0.3s; opacity: 0; }
.stagger-4 { animation-delay: 0.4s; opacity: 0; }
.stagger-5 { animation-delay: 0.5s; opacity: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

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

  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 1.5rem;
  }

  .search-input {
    width: 200px;
  }

  .search-input:focus {
    width: 200px;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

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

  .markdown-body pre {
    border-radius: 8px;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    border-radius: 0;
  }
}

/* ---------- Print Styles ---------- */
@media print {
  .nav,
  .footer,
  .toc-wrapper,
  .reading-progress {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .markdown-body {
    color: black;
  }

  .markdown-body pre {
    border: 1px solid #ddd;
  }
}

