/* ==========================================================================
   Хаб проектов ПрограмЛаб — тёмная тема, синие акценты
   ========================================================================== */
:root {
  --bg: #070b16;
  --bg-soft: #0b1120;
  --card: rgba(255, 255, 255, 0.035);
  --card-border: rgba(59, 130, 246, 0.22);
  --text: #e8eefb;
  --text-muted: #93a5c4;
  --primary: #3b82f6;
  --accent: #38bdf8;
  --gradient: linear-gradient(120deg, var(--primary), var(--accent));
  --radius: 20px;
  --font-head: 'Manrope', sans-serif;
  --font-body: 'Inter', sans-serif;
  color-scheme: dark;
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 55% at 70% -10%, rgba(59, 130, 246, 0.14), transparent 60%),
    radial-gradient(ellipse 60% 45% at 10% 110%, rgba(56, 189, 248, 0.10), transparent 55%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ---------- Фон: WebGL-волна + свечения ---------- */
.hub-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 1;
}
.hub-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
}
.hub-glow-1 {
  width: 480px; height: 480px;
  top: -140px; right: -80px;
  background: rgba(59, 130, 246, 0.18);
}
.hub-glow-2 {
  width: 420px; height: 420px;
  bottom: -140px; left: -100px;
  background: rgba(56, 189, 248, 0.12);
}

/* ---------- Шапка ---------- */
.hub-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 26px 24px 0;
}
.hub-logo { display: flex; align-items: center; gap: 12px; }
.hub-logo-img {
  height: 36px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}
.hub-site-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
  padding: 9px 16px;
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.hub-site-link:hover { background: rgba(59, 130, 246, 0.18); border-color: var(--primary); transform: translateY(-1px); }
.hub-site-link:focus-visible, .hub-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Hero ---------- */
.hub-main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 64px 24px 40px;
}
.hub-hero { text-align: center; margin-bottom: 48px; }
.hub-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 7px 15px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hub-tag::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.hub-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4.6vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
}
.hub-hero h1 span {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hub-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Сетка карточек ---------- */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 22px;
}
.hub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 26px 24px 22px;
  text-decoration: none;
  color: var(--text);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.hub-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.hub-card::after {
  content: '';
  position: absolute;
  width: 220px; height: 220px;
  top: -110px; right: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.25), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.hub-card:hover {
  transform: translateY(-6px);
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.06);
  box-shadow: 0 24px 60px rgba(3, 8, 20, 0.6), 0 0 0 1px rgba(59, 130, 246, 0.15);
}
.hub-card:hover::before, .hub-card:hover::after { opacity: 1; }
.hub-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.hub-card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.hub-card-icon svg { width: 26px; height: 26px; }
.hub-card-status {
  font-family: var(--font-head);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid rgba(147, 165, 196, 0.35);
  padding: 5px 11px;
  border-radius: 999px;
}
.hub-card-status--live {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.45);
  background: rgba(74, 222, 128, 0.08);
}
.hub-card-status--wip {
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.08);
}
.hub-card h2 {
  font-family: var(--font-head);
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 1.3;
}
.hub-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
}
.hub-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 4px;
  transition: gap 0.2s ease;
}
.hub-card:hover .hub-card-cta { gap: 12px; }

/* ---------- Замок доступа ---------- */
body.locked { overflow: hidden; }
.hub-lock {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 8, 18, 0.55);
  backdrop-filter: blur(28px) saturate(120%);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
}
.hub-lock[hidden] { display: none; }
.hub-lock-modal {
  width: 100%;
  max-width: 360px;
  background: rgba(13, 20, 38, 0.94);
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 18px;
  padding: 30px 28px 26px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.hub-lock-icon {
  width: 52px; height: 52px;
  margin: 0 auto 18px;
  border-radius: 14px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.hub-lock-modal h2 {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.hub-lock-modal p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.hub-lock-modal form {
  display: flex;
  gap: 10px;
}
.hub-lock-modal input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.hub-lock-modal input::placeholder { color: var(--text-muted); }
.hub-lock-modal input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}
.hub-lock-btn {
  background: linear-gradient(120deg, #3b82f6, #2563eb);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(59, 130, 246, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hub-lock-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(59, 130, 246, 0.45); }
.hub-lock-btn:focus-visible, .hub-lock-modal input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.hub-lock-error {
  color: #fca5a5;
  font-size: 0.82rem;
  margin-top: 12px;
}
.hub-lock.shake .hub-lock-modal { animation: hubShake 0.35s ease; }
@keyframes hubShake {
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* ---------- Футер ---------- */
.hub-footer {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 26px 24px 30px;
  border-top: 1px solid rgba(147, 165, 196, 0.14);
}
.hub-footer p { color: var(--text-muted); font-size: 0.82rem; text-align: center; }
.hub-footer a { color: var(--accent); text-decoration: none; }
.hub-footer a:hover { text-decoration: underline; }

/* ---------- Адаптив ---------- */
@media (max-width: 640px) {
  .hub-header { padding-top: 18px; }
  .hub-main { padding: 44px 18px 30px; }
  .hub-grid { grid-template-columns: 1fr; }
  .hub-site-link span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hub-card { transition: none; }
}
