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

:root {
  --bg: #0f0f14;
  --surface: #1a1a24;
  --surface-hover: #24243a;
  --border: #2a2a40;
  --text: #e4e4f0;
  --text-muted: #9898b0;
  --accent: #7c6ff7;
  --accent-glow: rgba(124, 111, 247, 0.3);
  --radius: 14px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===== Animated Grid Background ===== */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(124, 111, 247, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 111, 247, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridShift 20s linear infinite;
}

@keyframes gridShift {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(24px, 24px); }
  100% { transform: translate(0, 0); }
}

/* ===== Container ===== */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
}

/* ===== Title ===== */
.title {
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #e4e4f0 0%, #7c6ff7 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeSlideDown 0.8s ease both;
  margin-bottom: 0.3rem;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
  animation: fadeSlideDown 0.8s 0.15s ease both;
}

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  animation: fadeIn 0.8s 0.3s ease both;
}

/* ===== Card ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.2rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background 0.25s ease;
  animation: cardPop 0.5s ease both;
  /* stagger handled by inline style */
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.35),
    0 0 20px var(--accent-glow);
}

.card:active {
  transform: translateY(-2px) scale(0.98);
}

/* card icon */
.card-icon {
  font-size: 2.4rem;
  line-height: 1;
  transition: transform 0.3s ease;
}

.card:hover .card-icon {
  transform: scale(1.15) rotate(-6deg);
}

.card-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 0.15rem;
}

.card-url {
  font-size: 0.75rem;
  color: #6b6b88;
  font-family: "SF Mono", "Fira Code", "JetBrains Mono", "Consolas", monospace;
  word-break: break-all;
  max-width: 100%;
  transition: color 0.25s ease;
}

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

.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== Footer ===== */
.footer {
  margin-top: 3rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.5;
  animation: fadeIn 0.8s 0.5s ease both;
}

/* ===== Animations ===== */
@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes cardPop {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ===== Responsive ===== */
/* Tablet: 2 columns */
@media (max-width: 768px) {
  body { padding: 1.5rem 1rem; }
  .title { font-size: 1.7rem; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
}

/* Mobile: 1 column */
@media (max-width: 480px) {
  body { padding: 1rem 0.8rem; }
  .title { font-size: 1.4rem; }
  .card-grid { grid-template-columns: 1fr; gap: 0.9rem; }
  .card { padding: 1.2rem 1rem; }
  .card-icon { font-size: 2rem; }
}
