html {
  font-family: "Manrope", system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, sans-serif;
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  left: 8px;
  top: 8px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 8px 12px;
  border-radius: 8px;
}
.skip-link:focus {
  position: fixed;
  z-index: 1000;
  clip: auto;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  white-space: normal;
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding: 0 20px;
}
.section {
  padding: 72px 0;
}
.section h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
}
.lede {
  color: var(--muted);
  margin-top: 10px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

a {
  color: var(--link);
  text-decoration: none;
}
.nav a {
  color: var(--text);
}
a:hover {
  opacity: 0.85;
}
a:focus {
  outline: 2px dashed var(--border);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 0 0 0 var(--glow), var(--shadow);
  font-weight: 600;
  color: var(--text);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.btn:hover {
  box-shadow: 0 0 0 6px var(--glow), var(--shadow);
}
.btn:active {
  transform: translateY(1px);
}
.btn-secondary {
  background: transparent;
}

.list {
  display: grid;
  gap: 8px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.tag {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 14px;
}
.muted {
  color: var(--muted);
}
.strong {
  font-weight: 600;
}

.hero {
  padding: 96px 0 52px;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.hero .lede {
  font-size: 18px;
}
.hero-cta {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.site-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(10px);
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-weight: 700;
  letter-spacing: -0.01em;
}
.nav {
  display: flex;
  gap: 16px;
}
.mobile-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 0 0 0 var(--glow), var(--shadow);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.mobile-toggle:hover {
  box-shadow: 0 0 0 6px var(--glow), var(--shadow);
}
.mobile-toggle:active {
  transform: translateY(1px);
}
.mobile-toggle .bar {
  width: 18px;
  height: 2px;
  background: var(--text);
  display: block;
  border-radius: 2px;
}
.mobile-toggle .bar + .bar {
  margin-top: 3px;
}
.theme-picker select {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.timeline {
  display: grid;
  gap: 14px;
}
.timeline-item {
  display: flex;
  gap: 12px;
}
.timeline-item .when {
  min-width: 100px;
  color: var(--muted);
}

.grid.projects {
  grid-template-columns: repeat(3, 1fr);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

.top-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  display: none;
  color: var(--text);
}
.top-btn.show {
  display: block;
}

/* Loader overlay */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
  opacity: 1;
}
.loader-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--text);
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Particles canvas */
#tsparticles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
body {
  position: relative;
}

@media (max-width: 840px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .two-col {
    display: grid;
    gap: 20px;
  }
  .grid.projects {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 32px;
  }
  .mobile-toggle {
    display: flex;
  }
  .nav {
    position: fixed;
    inset: 64px 0 auto 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 12px;
    padding: 16px;
  z-index: 20; /* ensure menu overlays content */
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }
  .nav.open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .nav a {
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--card);
    border-radius: 10px;
    box-shadow: 0 0 0 0 var(--glow), var(--shadow);
  }
  .nav .menu-footer {
    margin-top: 8px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

@media (min-width: 841px) {
  .nav {
    display: flex;
  }
  .nav .menu-footer {
    border-top: 0;
    padding-top: 0;
    margin-left: auto;
  }
  .nav .menu-footer .muted {
    display: none;
  }
}

/* Pixel cats canvas at the bottom */
#pixel-cats {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  width: 100%;
  z-index: 1;
  pointer-events: none;
}

/* Search input styling */
input[type="search"] {
  width: 100%;
  max-width: 400px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(115, 79, 47, 0.1);
}

input[type="search"]::placeholder {
  color: var(--text-secondary);
}

/* Filter sections */
.filters {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.filters-section {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

/* Tag filters */
.tag-filter {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 20px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text);
}

.tag-filter:hover,
.tag-filter.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Blog specific styles */
.blog-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.blog-thumbnail {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 48px;
}

.blog-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.blog-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.blog-title a {
  color: var(--text);
  text-decoration: none;
}

.blog-title a:hover {
  color: var(--accent);
}

.blog-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.blog-excerpt {
  flex: 1;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.blog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.blog-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.featured-badge {
  background: linear-gradient(45deg, #ff6b35, #f7931e);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.read-time {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.blogs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .blogs-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .filters-section {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
  
  input[type="search"] {
    max-width: none;
  }
}
