
/* Hub page styles */
.hub-header {
  text-align: center;
  padding: clamp(1.5rem, 5vw, 3rem) clamp(0.75rem, 3vw, 1.5rem);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-soft);
}

.hub-header h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.6rem, 5vw, 3rem);
  margin: 0 0 0.5rem;
  color: var(--text);
}

.hub-header p {
  color: var(--text-muted);
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  margin: 0;
}

.hub-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem clamp(0.75rem, 3vw, 1.5rem);
}

.hub-main h2 {
  text-align: center;
  font-family: 'Fraunces', serif;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  margin-bottom: 2rem;
  color: var(--text);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1.5rem;
}

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

.module-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm);
}

.module-card:focus-within {
  outline: 2px solid var(--focus-ring, rgba(255, 138, 91, 0.6));
  outline-offset: 2px;
}

.module-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.module-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  margin: 0 0 0.5rem;
  color: var(--text);
}

.module-card p {
  color: var(--text-muted);
  font-size: clamp(0.82rem, 2vw, 0.9rem);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.module-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.module-links a {
  padding: 0.5rem 0.9rem;
  background: var(--bg-primary);
  color: var(--primary, var(--text-secondary));
  text-decoration: none;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-soft);
  min-height: var(--touch-min, 2.75rem);
  display: inline-flex;
  align-items: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.module-links a:hover {
  background: var(--bg-accent);
  border-color: var(--primary, var(--accent));
  color: var(--primary, var(--accent));
}

.module-links a:focus-visible {
  outline: 2px solid var(--focus-ring, rgba(255, 138, 91, 0.6));
  outline-offset: 2px;
}

.footer {
  text-align: center;
  padding: 2rem clamp(0.75rem, 3vw, 1.5rem);
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-soft);
  margin-top: 2rem;
}

/* ── Hub responsive: tablet ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .module-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 1rem;
  }

  .module-card {
    padding: 1.25rem;
  }
}

/* ── Hub responsive: small mobile ────────────────────────────────────── */
@media (max-width: 480px) {
  .module-grid {
    grid-template-columns: 1fr;
  }

  .module-card {
    padding: 1rem;
    border-radius: 0.75rem;
  }

  .hub-main {
    padding: 1.5rem 0.75rem;
  }
}

/* ── Staggered card entrance animation ──────────────────────────────── */
.module-card {
  opacity: 0;
  transform: translateY(12px);
  animation: hub-card-in 0.4s ease forwards;
}

@keyframes hub-card-in {
  to { opacity: 1; transform: translateY(0); }
}

.module-card:nth-child(1) { animation-delay: 0ms; }
.module-card:nth-child(2) { animation-delay: 50ms; }
.module-card:nth-child(3) { animation-delay: 100ms; }
.module-card:nth-child(4) { animation-delay: 150ms; }
.module-card:nth-child(5) { animation-delay: 200ms; }
.module-card:nth-child(6) { animation-delay: 250ms; }
.module-card:nth-child(7) { animation-delay: 300ms; }
.module-card:nth-child(8) { animation-delay: 350ms; }
.module-card:nth-child(9) { animation-delay: 400ms; }
.module-card:nth-child(10) { animation-delay: 450ms; }
.module-card:nth-child(11) { animation-delay: 500ms; }
.module-card:nth-child(12) { animation-delay: 550ms; }
.module-card:nth-child(13) { animation-delay: 600ms; }
.module-card:nth-child(14) { animation-delay: 650ms; }
.module-card:nth-child(15) { animation-delay: 700ms; }
.module-card:nth-child(16) { animation-delay: 750ms; }
.module-card:nth-child(17) { animation-delay: 800ms; }
.module-card:nth-child(18) { animation-delay: 850ms; }
.module-card:nth-child(19) { animation-delay: 900ms; }
.module-card:nth-child(20) { animation-delay: 950ms; }

@media (prefers-reduced-motion: reduce) {
  .module-card {
    opacity: 1;
    transform: none;
    animation: none;
  }
}
