:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface-hover: #1c2330;
  --border: #2d333b;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #7c3aed;
  --accent-2: #2563eb;
  --gradient: linear-gradient(135deg, var(--accent), var(--accent-2));
  --radius: 12px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-hover: #f0f0f2;
    --border: #e0e0e4;
    --text: #1a1c20;
    --muted: #5f6672;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo span {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.nav a:not(.lang-switch a) {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav a:not(.lang-switch a):hover {
  color: var(--text);
}

.lang-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.lang-switch button {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-switch button.active {
  background: var(--gradient);
  color: #fff;
}

.hero {
  padding: 96px 0 72px;
  text-align: center;
}

.hero-greeting {
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-name {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 8px 0 16px;
}

.hero-bio {
  max-width: 560px;
  margin: 0 auto 32px;
  color: var(--muted);
  font-size: 1.15rem;
}

.hero-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.btn:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.1);
  background: var(--gradient);
}

.section {
  padding: 72px 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-subtitle {
  color: var(--muted);
  margin-bottom: 40px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.2s;
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.card-title:hover {
  color: var(--accent-2);
}

.card-link-icon {
  flex-shrink: 0;
  color: var(--muted);
  transition: color 0.2s;
}

.card-link-icon:hover {
  color: var(--accent-2);
}

.card-desc {
  color: var(--muted);
  font-size: 0.92rem;
  flex-grow: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.topic {
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  font-weight: 500;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.83rem;
  color: var(--muted);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lang-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.skeleton-card {
  height: 170px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-hover) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite linear;
  border: 1px solid var(--border);
}

@keyframes shimmer {
  to { background-position-x: -200%; }
}

.error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.error-state .btn {
  margin-top: 16px;
  cursor: pointer;
}

.about-content {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 1.05rem;
}

.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 600px) {
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 12px 0;
    gap: 8px;
  }

  .hero {
    padding: 56px 0 48px;
  }

  .section {
    padding: 48px 0;
  }
}
