:root {
  --bg: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #555;
  --accent: #223C90;
  --accent-hover: #E72486;
  --border: #e0e0e0;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 10px;
  --code-bg: #f1f1f1;
  --tag-bg: #eee;
  --tag-text: #555;
  --hero-gradient: linear-gradient(135deg, #223C90 0%, #E72486 50%, #78B82A 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --text: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent: #E72486;
    --accent-hover: #78B82A;
    --border: #2a2a4a;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
    --code-bg: #1e1e3f;
    --tag-bg: #2a2a4a;
    --tag-text: #a0a0a0;
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Header / Nav */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.top-bar .logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.top-bar .logo span {
  color: var(--accent);
}

.top-bar nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.top-bar nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.top-bar nav a:hover,
.top-bar nav a.active {
  color: var(--accent);
}

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

.lang-switch a {
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border-right: 1px solid var(--border);
}

.lang-switch a:last-child {
  border-right: none;
}

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

.lang-switch a:not(.active) {
  opacity: 0.4;
}

.lang-switch a:not(.active):hover {
  opacity: 0.8;
}

/* Hero */
.hero {
  background: var(--hero-gradient);
  padding: 4rem 2rem;
  text-align: center;
  color: #fff;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
  letter-spacing: -0.03em;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

.hero .stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-top: 2rem;
}

.hero .stat {
  text-align: center;
}

.hero .stat-number {
  font-size: 2rem;
  font-weight: 800;
  display: block;
}

.hero .stat-label {
  font-size: 0.85rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Main content */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem;
}

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

.category h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* Shard cards */
.shard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.2rem;
}

.shard-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.shard-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.shard-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.shard-card h3 a {
  color: var(--text);
}

.shard-card h3 a:hover {
  color: var(--accent);
}

.shard-card .version {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'SF Mono', 'Fira Code', monospace;
  margin-bottom: 0.6rem;
}

.shard-card .description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.8rem;
}

.shard-card .links {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
}

.shard-card .links a {
  font-weight: 500;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

footer a {
  color: var(--text-secondary);
  font-weight: 500;
}

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

footer .aloli {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
  .hero .stats {
    gap: 1.5rem;
  }
  .shard-grid {
    grid-template-columns: 1fr;
  }
  .top-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}
