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

:root {
  --bg: #fafafa;
  --bg-secondary: #fff;
  --text: #1a1a1a;
  --text-muted: #666;
  --border: #e5e5e5;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --tag-bg: #f0f0f0;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --bg-secondary: #141414;
    --text: #fafafa;
    --text-muted: #a0a0a0;
    --border: #262626;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --tag-bg: #1f1f1f;
  }
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.full-width {
  max-width: 100%;
  padding: 2rem 4rem;
}

/* Links */
a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Navigation - Minimal top-right style */
.nav-minimal {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 4rem;
  z-index: 100;
  background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 60%, transparent 100%);
}

.nav-home {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
}

/* Old nav style for reference */
nav:not(.nav-minimal) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Main */
main {
  flex: 1;
}

/* Landing Page */
.landing-page {
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 100vh;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

#stars-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 0;
}

.landing-page main {
  position: relative;
  z-index: 1;
}

.landing-page main {
  flex: none;
  width: 100%;
  max-width: 500px;
}

/* Landing footer */
.footer-landing {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 1.5rem;
  position: fixed;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  z-index: 1;
}

.footer-content {
  display: contents;
}

.languages-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.languages-text .lang {
  color: var(--text);
  font-weight: 500;
}

.footer-icons {
  display: flex;
  gap: 1rem;
}

.footer-icons a,
.footer-icons .email-btn {
  color: var(--text-muted);
  transition: all 0.2s ease;
  display: flex;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
}

.footer-icons a:hover,
.footer-icons .email-btn:hover {
  color: var(--accent);
}

.email-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  margin-bottom: 6px;
}

.email-btn.copied .email-tooltip {
  opacity: 1;
}

/* Landing Hero */
.hero-landing {
  margin-bottom: 2.5rem;
}

.greeting {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
}

.name {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  color: var(--text);
  animation: fadeIn 0.5s ease 0.1s forwards;
  opacity: 0;
}

.tagline {
  font-size: 1rem;
  color: var(--text-muted);
  animation: fadeIn 0.5s ease 0.2s forwards;
  opacity: 0;
}

/* Quick Links */
.quick-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  animation: fadeIn 0.5s ease 0.3s forwards;
  opacity: 0;
}

.quick-link {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  text-decoration: none;
  transition: all 0.2s ease;
  text-align: left;
  min-width: 180px;
}

.quick-link:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.quick-link-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.quick-link-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Languages */
.languages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  animation: fadeIn 0.5s ease 0.4s forwards;
  opacity: 0;
}

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

.languages-list {
  font-size: 0.9rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Page Headers */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 3rem 0 1.5rem;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

/* About page */
.intro {
  margin-bottom: 4rem;
}

.intro p {
  font-size: 1.2rem;
  color: var(--text);
  line-height: 1.8;
}

/* Interests */
.interests {
  margin-bottom: 3rem;
}

.interests ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.interests li {
  background: var(--tag-bg);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

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

.interests li::before {
  content: none;
}

/* Page subtitle */
.page-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: -1rem;
  margin-bottom: 2.5rem;
}

/* Projects page - Categorized compact */
.full-width main {
  padding-top: 4rem;
}

.projects-page {
  max-width: 1200px;
  margin: 0 auto;
}

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

.projects-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  letter-spacing: -0.03em;
}

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

/* Category sections */
.project-category {
  margin-bottom: 2.5rem;
}

.category-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.category-icon {
  font-size: 1.1rem;
}

/* Project row - horizontal scroll */
.project-row {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.5rem 0 1rem;
  margin: 0 -4rem;
  padding-left: 4rem;
  padding-right: 4rem;
  scrollbar-width: none;
}

.project-row::-webkit-scrollbar {
  display: none;
}

/* Project item - compact card */
.project-item {
  flex: 0 0 260px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.project-item:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  color: var(--text);
}

.project-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.project-item-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.stars {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.project-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
  flex: 1;
}

.project-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.project-item-tags span {
  background: var(--tag-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.project-item:hover .project-item-tags span {
  color: var(--accent);
}

/* View all link */
.view-all-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.view-all-link:hover {
  color: var(--accent);
}

@media (max-width: 768px) {
  body.full-width {
    padding: 2rem 1.5rem;
  }

  .nav-minimal {
    padding: 1rem 1.5rem;
  }

  .project-row {
    margin: 0 -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .project-item {
    flex: 0 0 240px;
  }

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

  /* Landing page mobile */
  .landing-page {
    padding: 1.5rem;
    padding-bottom: 6rem;
  }

  .name {
    font-size: 2rem;
  }

  .tagline {
    font-size: 0.9rem;
  }

  .quick-links {
    flex-direction: column;
    gap: 0.75rem;
  }

  .quick-link {
    padding: 1rem 1.25rem;
  }

  .footer-landing {
    flex-direction: column;
    gap: 1rem;
    padding: 0 1rem;
    bottom: 1rem;
    text-align: center;
  }

  .languages-text {
    font-size: 0.75rem;
  }

  .footer-icons {
    gap: 1.25rem;
  }
}

/* Blog page */
.blog-page {
  max-width: 1200px;
  margin: 0 auto;
}

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

.blog-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.03em;
}

/* Search box */
.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  transition: border-color 0.2s ease;
}

.search-box:focus-within {
  border-color: var(--accent);
}

.search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-box input {
  background: none;
  border: none;
  outline: none;
  font-size: 0.9rem;
  color: var(--text);
  width: 180px;
}

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

/* Posts grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 140px;
}

.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.post-card time {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 0.4rem 0;
  line-height: 1.3;
}

.post-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
  flex: 1;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.post-tags span {
  font-size: 0.65rem;
  color: var(--text-muted);
  background: var(--tag-bg);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  gap: 0.75rem;
  min-height: 60vh;
}

.empty-state svg {
  opacity: 0.4;
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  margin: 0;
}

.empty-state span {
  font-size: 0.9rem;
  opacity: 0.7;
}

@media (max-width: 600px) {
  .blog-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    width: 100%;
  }
}

/* Post page */
.post-header {
  margin-bottom: 3rem;
}

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

.post-header time {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.post-content {
  margin-bottom: 3rem;
}

.post-content p {
  color: var(--text);
  font-size: 1.05rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: 8px;
}

.post-content code {
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.9em;
  background: var(--tag-bg);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

.post-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 8px;
}

.post-content pre code {
  background: none;
  padding: 0;
}

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

.post-content ul, .post-content ol {
  margin: 1rem 0 1rem 1.5rem;
  color: var(--text);
}

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

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

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

/* Footer - Minimal */
.footer-minimal {
  margin-top: 4rem;
  padding: 2rem 0;
  text-align: center;
}

.footer-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.footer-icons a {
  color: var(--text-muted);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-icons a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.footer-icons svg {
  display: block;
}

/* Responsive */
@media (max-width: 600px) {
  body {
    padding: 2rem 1.25rem;
  }

  nav {
    margin-bottom: 3rem;
  }

  .nav-links {
    gap: 1.25rem;
  }

  .name {
    font-size: 2.25rem;
  }

  .tagline {
    font-size: 1.1rem;
  }

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

  h1 {
    font-size: 2rem;
  }
}
