:root {
  --primary-color: #526a98;
  --primary-hover: #435980;
  --secondary-color: #3a3d4a;
  --bg-dark: #030f1f;
  --bg-panel: #131a28;
  --bg-section: #192233;
  --text-primary: #e6edf6;
  --text-secondary: #9aa4b2;
  --text-muted: #6b7280;
  --border-color: #263347;
  --preview-border: #2f3d54;
}

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

html,
body {
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

.hub-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hub-background::before {
  content: "";
  position: absolute;
  inset: -10% 0 0 -10%;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cpath d='M0 0H180M0 0V180' stroke='%239aa4b2' stroke-opacity='0.08' stroke-width='1'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cpath d='M0 0H72M0 0V72' stroke='%239aa4b2' stroke-opacity='0.04' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 220px 220px, 80px 80px;
  opacity: 0.6;
  animation: gridDrift 80s linear infinite;
}

.hub-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Ccircle cx='8' cy='12' r='1'/%3E%3Ccircle cx='38' cy='22' r='1'/%3E%3Ccircle cx='90' cy='32' r='1'/%3E%3Ccircle cx='64' cy='72' r='1'/%3E%3Ccircle cx='18' cy='92' r='1'/%3E%3Ccircle cx='108' cy='90' r='1'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.35;
  animation: noiseShift 14s steps(6) infinite;
}

.hub-orbit {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(82, 106, 152, 0.22);
  box-shadow: inset 0 0 24px rgba(82, 106, 152, 0.08);
  opacity: 0.7;
}

.hub-orbit-one {
  width: 420px;
  height: 420px;
  top: -140px;
  right: -140px;
  animation: orbitFloat 26s ease-in-out infinite;
}

.hub-orbit-two {
  width: 560px;
  height: 560px;
  bottom: -220px;
  left: -220px;
  opacity: 0.45;
  animation: orbitFloat 34s ease-in-out infinite reverse;
}

.hub-container {
  min-height: 100vh;
  padding: 52px 20px 64px;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
  z-index: 1;
}

.hub-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hub-header::after {
  content: "";
  width: 120px;
  height: 2px;
  background: rgba(82, 106, 152, 0.5);
  margin: 4px auto 0;
  border-radius: 999px;
}

.hub-eyebrow {
  letter-spacing: 2px;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  animation: headerSlide 0.6s ease both;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.hub-home-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.hub-home-link:hover {
  color: var(--text-primary);
}

.hub-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  animation: headerSlide 0.6s ease 0.08s both;
}

.hub-subtitle {
  max-width: 640px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 15px;
  animation: headerSlide 0.6s ease 0.16s both;
}

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

.hub-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  animation: cardEnter 0.55s ease both;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hub-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(82, 106, 152, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.hub-card:hover {
  border-color: rgba(82, 106, 152, 0.45);
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.42);
}

.hub-card:hover::before {
  opacity: 1;
}

.hub-card:nth-child(2) {
  animation-delay: 0.08s;
}

.hub-card:nth-child(3) {
  animation-delay: 0.16s;
}

.hub-card-featured {
  padding: 22px;
}

.hub-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hub-read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.6px;
  padding-left: 2px;
  transition: color 0.2s ease;
}

.hub-read-more::after {
  content: "";
  width: 14px;
  height: 8px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M0 4h11M8 1l3 3-3 3' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: translateY(1px);
}

.hub-read-more:hover {
  color: var(--text-primary);
}

.hub-card-kicker {
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hub-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #34d399;
  box-shadow: 0 0 0 rgba(52, 211, 153, 0.4);
  animation: livePulse 1.6s ease-out infinite;
}

.hub-card-title {
  font-size: 16px;
  font-weight: 600;
}

.hub-icon-link {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.hub-icon-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.hub-icon-link:hover {
  border-color: var(--primary-color);
  color: var(--text-primary);
  background: var(--bg-section);
}

.hub-icon-link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.hub-read-more.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.hub-card-main {
  display: grid;
  gap: 14px;
}

.hub-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hub-preview-image {
  border-radius: 12px;
  background: #0c1321;
  border: 1px dashed var(--preview-border);
  min-height: 160px;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 11px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.hub-preview-image::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 10px;
  border: 1px solid rgba(154, 164, 178, 0.12);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.hub-preview-placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='120' viewBox='0 0 220 120'%3E%3Cpath d='M0 0L220 120M220 0L0 120' stroke='%239aa4b2' stroke-opacity='0.14' stroke-width='1'/%3E%3C/svg%3E");
  opacity: 0.4;
}

.hub-preview-image span {
  position: relative;
  z-index: 1;
}

.hub-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hub-preview-placeholder {
  animation: previewPulse 3.2s ease-in-out infinite;
}

.hub-card:hover .hub-preview-image {
  transform: translateY(-2px);
  border-color: rgba(82, 106, 152, 0.55);
}


.hub-card-desc {
  color: var(--text-secondary);
  font-size: 13px;
}

.hub-inline-link {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid rgba(82, 106, 152, 0.5);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.hub-inline-link:hover {
  color: var(--text-primary);
  border-color: rgba(82, 106, 152, 0.9);
}

.hub-card-subtitle {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.hub-card-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.hub-link {
  text-decoration: none;
  color: var(--text-primary);
  background: var(--primary-color);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.hub-link:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.hub-link.is-disabled {
  pointer-events: none;
  opacity: 0.5;
}

.hub-card-muted .hub-preview-image {
  background: #0f1626;
  border-color: rgba(38, 51, 71, 0.8);
}

.hub-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: auto;
  padding-top: 24px;
}

@keyframes gridDrift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(120px, 120px, 0);
  }
}

@keyframes noiseShift {
  0%,
  100% {
    opacity: 0.3;
    transform: translate3d(0, 0, 0);
  }
  50% {
    opacity: 0.45;
    transform: translate3d(-10px, 10px, 0);
  }
}

@keyframes orbitFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(18px, -12px, 0);
  }
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes previewPulse {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(82, 106, 152, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(82, 106, 152, 0.08);
  }
}

@keyframes headerSlide {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes livePulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(52, 211, 153, 0.45);
  }
  70% {
    transform: scale(1.35);
    box-shadow: 0 0 0 8px rgba(52, 211, 153, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(52, 211, 153, 0);
  }
}

@media (min-width: 900px) {
  .hub-header {
    text-align: left;
    align-items: flex-start;
  }

  .hub-header::after {
    margin-left: 0;
  }

  .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hub-card-featured {
    grid-column: span 2;
  }

  .hub-card-featured .hub-card-main {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
    gap: 20px;
  }

  .hub-card-featured .hub-preview-image {
    min-height: 220px;
  }
}

@media (max-width: 700px) {
  .hub-card {
    padding: 16px;
  }

  .hub-card-featured {
    padding: 18px;
  }

  .hub-preview-image {
    min-height: 130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-background::before,
  .hub-background::after,
  .hub-orbit,
  .hub-card,
  .hub-preview-placeholder,
  .hub-eyebrow,
  .hub-title,
  .hub-subtitle {
    animation: none;
  }

  .hub-card,
  .hub-preview-image,
  .hub-link,
  .hub-icon-link {
    transition: none;
  }
}
