:root{
  --bg:#f2f5fb;
  --core-colour:#4c63ff;
  --box-bg:#ffffff;
  --box-text:#333333;
  --accent:#9aa7ff;
  --glow:rgba(76,99,255,0.45);
}

*{box-sizing:border-box}

html,body{height:100%}

body{
  margin:0;
  background:var(--bg);
  display:grid;
  place-items:center;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  overflow:hidden;
}

/* HUB */
.hub{
  position:relative;
  width:900px;
  height:600px;
  max-width:96vw;
  max-height:92vh;
}

/* CONNECTORS */
svg.connectors{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
}

svg line{
  stroke:var(--accent);
  stroke-width:2;
  stroke-dasharray:600;
  stroke-dashoffset:600;
  transition:stroke-dashoffset 1s ease;
  opacity:.9;
}

.hub.active svg line{
  stroke-dashoffset:0;
}

/* CORE */
.core{
  position:absolute;
  inset:0;
  margin:auto;
  width:180px;
  height:180px;
  border-radius:50%;
  background:radial-gradient(circle at 30% 30%, #6f81ff, var(--core-colour));
  box-shadow:
    0 0 0 22px rgba(76,99,255,.08),
    0 0 0 44px var(--glow),
    0 25px 60px rgba(0,0,0,.22);
  display:grid;
  place-items:center;
  cursor:pointer;
  z-index:5;
  user-select:none;
}

.core-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:8px;
}

.core-grid span{
  width:10px;
  height:10px;
  border-radius:50%;
  background:#fff;
  opacity:.95;
}

/* MENU ITEMS */
.menu-item{
  position:absolute;
  width:240px;
  min-height:86px;
  background:var(--box-bg);
  color:var(--box-text);
  border-radius:22px;
  display:flex;
  align-items:center;
  gap:14px;
  padding:16px 18px;
  font-weight:700;
  box-shadow:0 18px 38px rgba(0,0,0,.16);
  cursor:pointer;

  /* hidden until hub active */
  opacity:0;
  pointer-events:none;
  transform:scale(.35);

  transition:
    opacity .35s ease,
    transform .55s cubic-bezier(.22,.61,.36,1),
    box-shadow .25s ease;
  user-select:none;
}

.hub.active .menu-item{
  opacity:1;
  pointer-events:auto;
  transform:scale(1);
}

.menu-item:hover{
  box-shadow:
    0 0 0 3px rgba(76,99,255,.18),
    0 26px 60px rgba(0,0,0,.22);
}

/* ICON PLACEHOLDER */
.icon{
  width:42px;
  height:42px;
  border-radius:50%;
  display:grid;
  place-items:center;
  color:#fff;
  font-size:14px;
  font-weight:900;
  background:linear-gradient(135deg,#6f81ff,var(--core-colour));
  flex-shrink:0;
  overflow:hidden;
}

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

.icon.icon-fallback{
  font-size:14px;
}

/* PANEL */
.panel{
  display:none;
  font-size:14px;
  line-height:1.35;
  font-weight:600;
  color:rgba(0,0,0,.55);
  margin-top:6px;
}

.menu-item.expanded{
  width:330px;
  min-height:190px;
  align-items:flex-start;
}

.menu-item.expanded .panel{
  display:block;
}

/* RESPONSIVE */
@media (max-width:760px){
  body{overflow:auto}
  .hub{height:520px}
  .menu-item{width:220px}
  .menu-item.expanded{width:300px}
}
