/* ===== IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;1,400;1,600&display=swap');

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  /* Light theme */
  --bg-primary: #fafaf9;
  --bg-secondary: #ffffff;

  --bg-card: #ffffff;
  --bg-header: rgba(248, 249, 250, 0.85);
  --text-primary: #1a1a2e;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --border-color: #e4e4e7;
  --border-light: #f0f0f3;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --tag-bg: #f4f4f5;
  --tag-border: #d4d4d8;
  --tag-text: #3f3f46;
  --dot-color: rgba(0, 0, 0, 0.08);
  --line-color: rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --verified-blue: #1d9bf0;
  --status-green: #22c55e;
  --github-l0: #ebedf0;
  --github-l1: #9be9a8;
  --github-l2: #40c463;
  --github-l3: #30a14e;
  --github-l4: #216e39;
  --quote-bg: #f0f4ff;
  --footer-bg: #f0f2f5;
  --card-hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
  --bg-primary: #09090b;
  --bg-secondary: #111113;
  --bg-card: #18181b;
  --bg-header: rgba(9, 9, 11, 0.85);
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border-color: #27272a;
  --border-light: #1e1e21;
  --accent: #e4e4e7;
  --accent-hover: #ffffff;
  --tag-bg: #18181b;
  --tag-border: #3f3f46;
  --tag-text: #a1a1aa;
  --dot-color: rgba(255, 255, 255, 0.03);
  --line-color: rgba(255, 255, 255, 0.02);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
  --status-green: #a1a1aa;
  --verified-blue: #a1a1aa;
  --quote-bg: #111113;
  --footer-bg: #09090b;
  --card-hover-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .project-image-placeholder {
  filter: grayscale(100%);
}

[data-theme="dark"] .section-title {
  background: none;
  -webkit-text-fill-color: var(--text-primary);
  color: var(--text-primary);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Dot grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* Diagonal line pattern overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: repeating-linear-gradient(-45deg,
      transparent,
      transparent 80px,
      var(--line-color) 80px,
      var(--line-color) 81px);
  pointer-events: none;
  z-index: 0;
}

/* ===== LAYOUT ===== */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}



/* ===== HEADER / NAV ===== */
.header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
}

.logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
  position: relative;
}

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

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s;
}

.search-hint:hover {
  border-color: var(--text-muted);
}

.search-hint svg {
  width: 14px;
  height: 14px;
}

.search-hint kbd {
  font-family: inherit;
  font-size: 0.68rem;
  padding: 1px 4px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  background: var(--tag-bg);
}

.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 4px;
}

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background-color 0.2s;
}

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

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

/* More dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.2s ease;
  z-index: 200;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.15s, color 0.15s;
}

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

.dropdown-item svg {
  width: 16px;
  height: 16px;
}

/* ===== SECTIONS ===== */
.section {
  margin-bottom: 0;
  padding: 40px 0;
  border-bottom: 1px solid var(--border-color);
  opacity: 0;
  transform: translateY(16px);
  animation: fadeInUp 0.5s ease forwards;
  scroll-margin-top: 80px;
  /* Offset for fixed header anchor jumps */
}

.section:last-of-type {
  border-bottom: none;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section:nth-child(1) {
  animation-delay: 0.05s;
}

.section:nth-child(2) {
  animation-delay: 0.1s;
}

.section:nth-child(3) {
  animation-delay: 0.15s;
}

.section:nth-child(4) {
  animation-delay: 0.2s;
}

.section:nth-child(5) {
  animation-delay: 0.25s;
}

.section:nth-child(6) {
  animation-delay: 0.3s;
}

.section:nth-child(7) {
  animation-delay: 0.35s;
}

.section:nth-child(8) {
  animation-delay: 0.4s;
}

.section-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.8rem;

  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== HERO SECTION ===== */
.hero {
  padding: 48px 0 40px;
  display: flex;
  align-items: flex-start;
  gap: 32px;
}

.avatar-wrapper {
  display: none;
  flex-shrink: 0;
  position: relative;
}

.avatar {
  width: 130px;
  height: 130px;
  border-radius: 16px;
  border: 2px solid var(--border-color);
  object-fit: cover;
  transition: transform 0.3s ease;
}

.avatar-wrapper:hover .avatar {
  transform: scale(1.03);
}

.hero-info {
  flex: 1;
  padding-top: 8px;
}

.hero-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.online-indicator {
  width: 8px;
  height: 8px;
  background: var(--status-green);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.view-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.view-count svg {
  width: 14px;
  height: 14px;
}

.hero-name {
  font-family: 'Inter', sans-serif;
  font-size: 2.2rem;

  font-weight: 600;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
  margin: 6px 0;
}

.verified-badge {
  width: 22px;
  height: 22px;
  color: var(--verified-blue);
  flex-shrink: 0;
}

.hero-tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hero-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== ABOUT ===== */
.about-list {
  list-style: disc;
  padding-left: 20px;
}

.about-list li {
  font-family: inherit;
  font-style: normal;
  font-size: 0.95rem;

  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.75;
}

/* ===== MUSIC CARD ===== */
.music-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  max-width: 400px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s, border-color 0.3s;
}

.music-card:hover {
  box-shadow: var(--shadow-md);
}

.music-art {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1db954, #191414);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spin-slow 8s linear infinite;
  flex-shrink: 0;
}

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

.music-art-inner {
  width: 18px;
  height: 18px;
  background: var(--bg-card);
  border-radius: 50%;
}

.music-info {
  flex: 1;
}

.music-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--status-green);
  margin-bottom: 2px;
}

.music-label::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--status-green);
  border-radius: 50%;
}

.music-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.music-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.music-icon {
  color: #1db954;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ===== CONNECT ===== */
.connect-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.connect-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--bg-card);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.connect-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

/* ===== GITHUB ACTIVITY ===== */
.github-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.github-header svg {
  width: 14px;
  height: 14px;
}

.github-calendar {
  width: 100%;
  overflow-x: auto;
}

.github-grid {
  display: flex;
  gap: 3px;
  margin-bottom: 8px;
}

.github-month-labels {
  display: flex;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  padding-left: 30px;
}

.github-month-labels span {
  flex: 1;
}

.github-day-labels {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-right: 6px;
  padding-top: 2px;
}

.github-day-labels span {
  height: 11px;
  line-height: 11px;
}

.calendar-wrapper {
  display: flex;
}

.github-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.github-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--github-l0);
}

.github-cell.l1 {
  background: var(--github-l1);
}

.github-cell.l2 {
  background: var(--github-l2);
}

.github-cell.l3 {
  background: var(--github-l3);
}

.github-cell.l4 {
  background: var(--github-l4);
}

.github-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.github-legend {
  display: flex;
  align-items: center;
  gap: 4px;
}

.github-legend .github-cell {
  width: 10px;
  height: 10px;
}

.github-activity-count {
  color: var(--status-green);
}

/* ===== EXPERIENCE & EDUCATION ===== */
.timeline {
  list-style: none;
}

.timeline-item {
  position: relative;
  padding-left: 24px;
  padding-bottom: 32px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--bg-primary);
  z-index: 1;
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 20px;
  bottom: 0;
  width: 1px;
  background: var(--border-color);
}

.timeline-item:last-child::after {
  display: none;
}

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

.timeline-company {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.timeline-company a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

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

.timeline-role-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 0;
}

.timeline-role-left {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.timeline-icon {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.timeline-role {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.timeline-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.timeline-meta span+span::before {
  content: '|';
  margin-right: 8px;
}

.timeline-expand {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.timeline-expand:hover {
  color: var(--text-primary);
}

.timeline-expand svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.timeline-item.expanded .timeline-expand svg {
  transform: rotate(180deg);
}

/* Expandable details */
.timeline-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 0;
  padding-left: 32px;
}

.timeline-item.expanded .timeline-details {
  max-height: 300px;
  opacity: 1;
  margin-top: 8px;
}

.timeline-details ul {
  list-style: disc;
  padding-left: 18px;
}

.timeline-details li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 6px;
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding-left: 32px;
}

.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 3px 10px;
  border: 1px solid var(--tag-border);
  border-radius: 6px;
  color: var(--tag-text);
  background: var(--tag-bg);
  white-space: nowrap;
}

/* ===== SKILLS GRID ===== */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.skill-category {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.skill-category:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.skill-category-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.skill-category .tag {
  margin-bottom: 4px;
  margin-right: 4px;
  display: inline-block;
}

/* ===== CERTIFICATIONS ===== */
.cert-list {
  list-style: none;
}

.cert-item {
  border-bottom: 1px solid var(--border-light);
}

.cert-item:last-child {
  border-bottom: none;
}

.cert-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  text-decoration: none;
  color: inherit;
  width: 100%;
  transition: all 0.2s ease;
}

.cert-link:hover {
  background: var(--tag-bg);
  padding-left: 12px;
  padding-right: 12px;
  margin-left: -12px;
  margin-right: -12px;
  border-radius: 8px;
}

.cert-info {
  flex: 1;
  min-width: 0;
}

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

.cert-icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.cert-name {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.cert-issuer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.cert-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.cert-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding-left: 8px;
}

.external-link-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  opacity: 0.4;
  transition: all 0.2s ease;
}

.cert-link:hover .external-link-icon {
  opacity: 1;
  color: var(--accent);
  transform: translate(1px, -1px);
}

/* ===== QUOTE ===== */
.quote-section {
  background: var(--quote-bg);
  text-align: center;
  padding: 60px 24px;
  margin: 0 -24px;
  border-bottom: 1px solid var(--border-color);
}

.quote-icon {
  font-size: 3rem;
  color: var(--text-muted);
  opacity: 0.3;
  margin-bottom: 16px;
  line-height: 1;
}

.quote-text {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.25rem;
  color: var(--text-primary);
  max-width: 560px;
  margin: 0 auto 20px;
  line-height: 1.7;
}

.quote-author {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.quote-author::before,
.quote-author::after {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--border-color);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--footer-bg);
  padding: 32px 24px;
  margin: 0 -24px;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-color);
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.footer-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.8;
}

/* Pixel cat */
.pixel-cat {
  width: 64px;
  height: 48px;
  position: relative;
}

.pixel-cat-zzz {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--text-muted);
  position: absolute;
  top: -8px;
  right: 0;
  animation: float-zzz 2s ease-in-out infinite;
}

@keyframes float-zzz {

  0%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  50% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.pixel-cat svg {
  width: 64px;
  height: 48px;
}

/* ===== PROJECTS PAGE ===== */
.projects-header {
  padding: 40px 0 24px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.projects-subtitle {
  font-family: inherit;
  font-style: normal;
  font-size: 0.95rem;

  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-bottom: 24px;
}

/* ===== FILTER TABS ===== */
.filter-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 56px;
  /* height of the fixed header */
  z-index: 90;
  background: var(--bg-primary);
  padding: 16px 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
}

.filter-tabs::before {
  content: 'Filter:';
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 4px;
}

.filter-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-tab:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.filter-tab.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

[data-theme="dark"] .filter-tab.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

/* ===== PROJECTS GRID ===== */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-bottom: 48px;
}

.project-card {
  position: relative; /* Base for stretched-link */
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
}

.project-card:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-4px);
  border-color: var(--text-muted);
}

.project-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
}

.project-image-placeholder {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
}

.project-image-placeholder .project-emoji {
  font-size: 3rem;
}

.project-body {
  display: flex;
  flex-direction: column;
  padding: 20px;
  flex: 1;
}

.project-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.project-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.project-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.project-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 14px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.project-actions {
  display: flex;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.project-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}

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

.project-action+.project-action {
  border-left: 1px solid var(--border-color);
}

.project-action svg {
  width: 14px;
  height: 14px;
}

/* Stretched link to make card clickable */
.stretched-link::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  pointer-events: auto;
  background-color: rgba(0, 0, 0, 0); /* Transparent bit to capture clicks */
}

/* ===== RESPONSIVE / MOBILE ===== */
@media (max-width: 768px) {


  .section {
    padding: 32px 0;
  }

  .hero {
    gap: 20px;
    padding: 64px 0 20px;
  }

  .avatar {
    width: 80px;
    height: 80px;
  }

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

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

  .connect-links {
    justify-content: center;
  }

  .search-hint {
    display: none;
  }

  .header-inner {
    padding: 0 12px;
  }

  .nav {
    gap: 4px;
    flex-wrap: nowrap;
  }

  .nav-link {
    padding: 6px 4px;
    font-size: 0.72rem;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .hero-name {
    font-size: 1.7rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .quote-text {
    font-size: 1.05rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

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

/* ===== UTILITY ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ===== BOOKS PAGE ===== */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
  padding-bottom: 64px;
}

.book-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  aspect-ratio: 2 / 3;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.book-card:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .book-card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.book-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.book-card:hover .book-image {
  transform: scale(1.1);
}

.book-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.1) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.book-card:hover .book-overlay {
  opacity: 1;
}

.book-title {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
  transform: translateY(10px);
  transition: transform 0.4s ease;
}

.book-author {
  color: rgba(255, 255, 255, 0.8);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  transform: translateY(10px);
  transition: transform 0.4s ease 0.1s;
}

.book-card:hover .book-title,
.book-card:hover .book-author {
  transform: translateY(0);
}

@media (max-width: 600px) {
  .books-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

/* ===== BLOGS ===== */
.blog-hero {
  padding-bottom: 1rem;
}

.blog-kicker {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1rem;
}

.blog-hero-title,
.article-title {
  font-size: clamp(2rem, 6vw, 3.15rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
}

.blog-hero-subtitle,
.article-lead {
  max-width: 62ch;
  color: var(--text-secondary);
  font-size: 1.02rem;
}

.blog-list-section {
  display: grid;
  gap: 1.25rem;
  padding-top: 0;
}

.blog-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(180deg, var(--bg-card), rgba(59, 130, 246, 0.08));
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-hover-shadow);
  border-color: rgba(59, 130, 246, 0.35);
}

.blog-card-topline,
.article-meta-row,
.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.blog-card-topline,
.article-meta-row {
  margin-bottom: 1rem;
}

.blog-date,
.article-meta,
.blog-card-meta span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.blog-card-title {
  font-size: 1.5rem;
  line-height: 1.25;
  margin-bottom: 0.9rem;
}

.blog-card-excerpt {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.blog-note {
  background: var(--quote-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  color: var(--text-secondary);
}

.article-page {
  max-width: 860px;
}

.article-shell {
  width: 100%;
}

.article-hero {
  padding-bottom: 0.5rem;
}

.article-content {
  padding-top: 0.5rem;
}

.article-content h2 {
  font-size: 1.45rem;
  margin: 2rem 0 0.8rem;
  letter-spacing: -0.02em;
}

.article-content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.article-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding-top: 0;
}

.media-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.media-card-header {
  margin-bottom: 0.9rem;
  flex-shrink: 0;
}

.media-card-header h2 {
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.media-card-header span,
.media-caption {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.media-caption {
  margin-top: auto;
  padding-top: 1rem;
}

.blog-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: block;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: #000;
}

.media-placeholder {
  min-height: 260px;
  border-radius: 16px;
  border: 1px dashed var(--border-color);
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(16, 185, 129, 0.1)),
    var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
  padding: 1.25rem;
}

.media-placeholder-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  color: var(--tag-text);
}

.article-quote {
  margin: 2rem 0;
  padding: 1.2rem 1.25rem;
  border-left: 3px solid var(--accent);
  background: var(--quote-bg);
  border-radius: 0 14px 14px 0;
  color: var(--text-primary);
  font-size: 1.02rem;
}

.inline-back-link {
  color: var(--accent);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
}

.inline-back-link:hover {
  text-decoration: underline;
}

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

  .blog-card,
  .media-card {
    padding: 1.1rem;
  }
}

/* ===== SUB-FILTERS ===== */
.sub-filter-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: -10px 0 30px;
  opacity: 0;
  animation: fadeInUp 0.4s ease forwards;
}

.sub-filter-tab {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sub-filter-tab:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.sub-filter-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .sub-filter-tab.active {
  color: #000 !important;
  background: var(--text-primary);
  border-color: var(--text-primary);
}

@media (max-width: 600px) {
  .sub-filter-tabs {
    flex-wrap: wrap;
  }
}
