:root {
  --bg: #0b0d12;
  --surface: #12151d;
  --surface-hover: #171b25;
  --border: #232836;
  --text: #e8eaf0;
  --muted: #9aa1b2;
  --accent: #8b7bff;
  --accent-2: #3dd6c6;
  --snake: #5bd36b;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

.glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(600px circle at 15% 0%, rgba(139, 123, 255, 0.18), transparent 60%),
    radial-gradient(500px circle at 90% 10%, rgba(61, 214, 198, 0.12), transparent 60%);
}

/* Hero */
.hero { padding: 36px 0 8px; }

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 960px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}

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

section { padding: 20px 0 8px; }

h2 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

.section-lead { margin: 2px 0 12px; color: var(--muted); }
.section-lead strong { color: var(--text); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* Cards */
.card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-3px);
  background: var(--surface-hover);
  border-color: rgba(139, 123, 255, 0.5);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }

.card-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: rgba(139, 123, 255, 0.12);
}

.card-icon svg { width: 24px; height: 24px; }

.card-icon img { width: 36px; height: 36px; object-fit: contain; }

.card-icon.app { background: none; }

.card-icon.app img { width: 100%; height: 100%; }

.card-icon.snake { color: var(--snake); background: rgba(91, 211, 107, 0.12); }

.card:has(.card-icon.snake):hover { border-color: rgba(91, 211, 107, 0.5); }

.card h3 { margin: 0; font-size: 1.2rem; }

.card p { margin: 0 0 14px; color: var(--muted); }

.card-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }

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

.btn:hover { border-color: var(--muted); }

.btn.primary {
  border-color: transparent;
  background: linear-gradient(90deg, var(--accent), #6f8bff);
  color: #fff;
}

.btn.primary:hover { transform: translateY(-1px); filter: brightness(1.1); }

.card:has(.card-icon.snake) .btn.primary {
  background: linear-gradient(90deg, #3fb950, var(--snake));
  color: #08130a;
}

a:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding: 18px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer p { margin: 0; }

.social { display: flex; gap: 18px; }

.social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: color 0.2s;
}

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

.social svg { width: 20px; height: 20px; }

/* 404 */
.notfound {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 96px 24px;
}

.notfound h1 { font-size: clamp(4rem, 14vw, 7rem); }

.notfound .lead { margin: 12px 0 24px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn { transition: none; }
  .card:hover, .btn.primary:hover { transform: none; }
}
